fix(generator): filter out empty services from api.services#8686
Open
shivanee-p wants to merge 2 commits into
Open
fix(generator): filter out empty services from api.services#8686shivanee-p wants to merge 2 commits into
shivanee-p wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the default owner and team members in the CODEOWNERS file, and filters services in the TypeScript GAPIC generator to only include those with methods or specific mixins (IAMPolicyMixin, LocationMixin). Feedback was provided to improve the service filtering logic by using idiomatic truthy checks (!!) instead of comparing potentially boolean or undefined mixin properties with > 0.
9d255e0 to
cabde93
Compare
cabde93 to
7fd2d1c
Compare
…a/api.ts Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.
The TypeScript generator does not generate the corresponding client class files if the proto files have services with zero RPC methods, resulting in compilation failures due to missing client file imports (e.g. Cannot find module './sql_available_database_versions_service_client').
This recently caused build failures in the google-cloud-sql package regeneration (PR 8626), which defines several empty placeholder/internal services like SqlRegionsService and SqlEventsService.
This PR filters out "empty" services from the services collection in the API schema generator class (core/generator/gapic-generator-typescript/typescript/src/schema/api.ts).
A service is considered empty and skipped if it has:
This prevents the generator from producing client classes and index.ts exports for non-functional empty services.
Testing
Unit Tests: Ran all 155 unit tests of the generator; all passed successfully with no regressions.