Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/grpc multipackage #3418

Merged
merged 10 commits into from
Jan 24, 2020

Conversation

AlexDaSoul
Copy link

before:

grpcOptions: <GrpcOptions>{
    transport: Transport.GRPC,
    options: {
        url: 'url',
        package: 'name.package',
        protoPath: 'alone.proto'
    }
}

after:

grpcOptions: <GrpcOptions>{
    transport: Transport.GRPC,
    options: {
        url: 'url',
        package: ['name.package', 'other.package'],
        protoPath: [
        'one.proto',
        'two.proto',
        'any.proto'
        ]
    }
}

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Added use packages and protos from external libraries ang default grpc functionality also https://github.com/grpc/grpc/blob/master/src/proto/grpc/health/v1/health.proto

grpcOptions: <GrpcOptions>{
    transport: Transport.GRPC,
    options: {
        url: 'url',
        package: ['name.package', 'grpc'],
        protoPath: [ 'name.proto', 'health.proto'],
        loader: {
            includeDirs: ['project', 'grpc/health/v1']
        }
    }
}

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Discussion #1733 (comment)

Alex Dukhnovskiy added 10 commits October 2, 2019 16:29
before:
grpcOptions: <GrpcOptions>{
    transport: Transport.GRPC,
    options: {
        url: 'url',
        package: 'name.package',
        protoPath: 'alone.proto'
    }
}
after:
grpcOptions: <GrpcOptions>{
    transport: Transport.GRPC,
    options: {
        url: 'url',
        package: ['name.package', 'other.package'],
        protoPath: [
        'one.proto',
        'two.proto',
        'any.proto'
        ]
    }
}
…nfig

before:

grpcOptions: <GrpcOptions>{
    transport: Transport.GRPC,
    options: {
        url: 'url',
        package: 'name.package',
        protoPath: 'alone.proto'
    }
}
after:

grpcOptions: <GrpcOptions>{
    transport: Transport.GRPC,
    options: {
        url: 'url',
        package: ['name.package', 'other.package'],
        protoPath: [
        'one.proto',
        'two.proto',
        'any.proto'
        ]
    }
}
# Conflicts:
#	integration/microservices/src/grpc/grpc.controller.ts
#	packages/microservices/client/client-grpc.ts
#	packages/microservices/server/server-grpc.ts
@AlexDaSoul
Copy link
Author

Old PR: #3097

@coveralls
Copy link

Pull Request Test Coverage Report for Build 7436

  • 34 of 35 (97.14%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.007%) to 95.279%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/microservices/client/client-grpc.ts 23 24 95.83%
Totals Coverage Status
Change from base Build 7424: -0.007%
Covered Lines: 4420
Relevant Lines: 4639

💛 - Coveralls

@EndyKaufman
Copy link

@kamilmysliwiec may be use with 'S':

grpcOptions: <GrpcOptions>{
    transport: Transport.GRPC,
    options: {
        url: 'url',
        packages: ['name.package', 'other.package'],
        protoPaths: [
        'one.proto',
        'two.proto',
        'any.proto'
        ]
    }
}

on my current work need this feature ( please answer for question?

@pumano
Copy link
Contributor

pumano commented Dec 24, 2019

Helpful feature, because usually you need use multiple proto files in each microservice

@kamilmysliwiec kamilmysliwiec merged commit 8dffee8 into nestjs:master Jan 24, 2020
@kamilmysliwiec
Copy link
Member

kamilmysliwiec commented Jan 24, 2020

Thank you! It will be published as part of a 6.11.0 release.

@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants