fix: add logic to check for IAM RPC methods within the service before adding mixin to avoid generating duplicate methods#906
Draft
shivanee-p wants to merge 13 commits intomainfrom
Draft
Conversation
… adding mixin to avoid generating duplicate methods
sofisl
reviewed
Feb 24, 2026
generator/gapic-generator-typescript/typescript/src/generator.ts
Outdated
Show resolved
Hide resolved
sofisl
reviewed
Feb 24, 2026
generator/gapic-generator-typescript/typescript/src/generator.ts
Outdated
Show resolved
Hide resolved
sofisl
reviewed
Feb 24, 2026
Contributor
sofisl
left a comment
There was a problem hiding this comment.
I think you're on the right track, but I think you want to create a new function that sets the mixins to 0 in augmentService if they already exist in the protos. take a look at what getSelectiveGapic does - it's kind of similar to what we want to do. I basically think we want to do something like, if there are the mixin methods already in the service's methods, then we want to set the mixin to 0 (kind of similar to the logic in lines 1063 - 1072).
Another idea is to talk to other languages to see what logic they use. I'd assume we're just doing some regex checking (i.e., if methods have 'iam' or "locations', then don't set the mixin), but I'm not sure - worth checking!
…check for method name conflicts with the IAM and Location mixins before generating the methods. This is to avoid generating duplicate methods in cases where the service already has methods with the same names as those provided by the mixins. Based on https://google.aip.dev/client-libraries/4234#overriding-a-duplicate-rpc, some mixin methods may be defined within the service file, but not necessarily all. The generator will silently skip the duplicate mixin methods for the IAM and Location mixins.
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.
add logic to check for IAM RPC methods within the service before adding mixin to avoid generating duplicate methods
Fixes #905 🦕