feat: Do not generate Service REST code if there are no matching RPC in a Service#1236
Merged
feat: Do not generate Service REST code if there are no matching RPC in a Service#1236
Conversation
blakeli0
reviewed
Jan 10, 2023
.../google/api/generator/gapic/composer/common/AbstractServiceCallableFactoryClassComposer.java
Outdated
Show resolved
Hide resolved
Contributor
|
Can we have a golden test(either in the unit tests or integration tests) so that we can easily compare the diff introduced by this PR? |
Member
Author
Yep! Working on it. I was playing around with the showcase tests but I'll sync up with Burke about getting this setup/ working. |
c8e67bf to
d7ebc76
Compare
blakeli0
approved these changes
Jan 25, 2023
f380782 to
3435225
Compare
Member
Author
|
Will need to do some more local testing to ensure if Http methods are properly generated and that I'm not breaking the generated client libraries. Changes from showcase and goldens look good. Sample application using apigee connect v1: Output: |
|
Kudos, SonarCloud Quality Gate passed! |
This was referenced Feb 9, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








This is a PR for Part 2 of Issue #1117: Do not generate any Service related REST code if there are no enabled REST RPC in a Service
Part 1 (MERGED) : #1211
What this PR attempts to do:
HttpJson{Service_Name}CallableFactory(generated by AbstractServiceCallableFactoryClassComposer and the sub composers)HttpJson{Service_Name}Stub(generated by AbstractTransportServiceStubClassComposer and the sub composers){Service_Name}StubSettings(generated by AbstractServiceStubSettingsClassComposer and the sub composers){Service_Name}ServiceSettings(generated by AbstractServiceSettingsClassComposer and the sub composers){Service_Name}ClientHttpJsonTest(generated byAbstractServiceClientTestClassComposerand sub composers)Service class exposes a new
hasAnyEnabledMethodsForTransport()to determine if the above logic is needed for the Transports (gRPC -> Always enabled vs HttpJson -> Needs to enabled/ eligible).