Repository navigation
feat(gapic-generator): add rpc_name metadata to mixin schema definitions - #18516
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces an rpc_name field to the MixinMethod class in wrappers.py and populates it for various mixin methods in mixins.py. It also updates the unit tests in test_api.py to assert the correct assignment of these RPC names. Additionally, the changes include import reorganization and minor code formatting improvements across the modified files. There are no review comments to address.
chalmerlowe
commented
Sep 30, 2026
| api_schema = api.API.build(fd, "google.example.v1", opts=opts) | ||
| res = api_schema.mixin_api_signatures | ||
| assert res == mixins.MIXINS_MAP | ||
| assert res["GetOperation"].rpc_name == "google.longrunning.Operations/GetOperation" |
Contributor
Author
There was a problem hiding this comment.
These are the only logic changes to this file.
Everything else should be simply ruff reformating.
chalmerlowe
commented
Sep 30, 2026
| name: str | ||
| request_type: str | ||
| response_type: str | ||
| rpc_name: str = "" |
Contributor
Author
There was a problem hiding this comment.
This is the only logic changes to this file.
Everything else should be simply ruff reformating.
chalmerlowe
marked this pull request as ready for review
September 30, 2026 19:37
ohmayr
approved these changes
Sep 30, 2026
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.
Problem
GAPIC generator schema models define mixin methods (
MixinMethod) with request types, response types, and method names, but do not provide the canonical full gRPC RPC name (for example,google.longrunning.Operations/GetOperation). When generating telemetry, method span names, or interceptor routing for mixins, downstream templates lack a clean attribute for the full RPC name.Solution
rpc_nameattribute (defaulting to empty string) to theMixinMethoddataclass ingapic/schema/wrappers.py.gapic/schema/mixins.py(google.longrunning.Operations/*,google.iam.v1.IAMPolicy/*, andgoogle.cloud.location.Locations/*).tests/unit/schema/test_api.pyvalidating that mixin schema signatures contain the expected RPC names.Notes for Reviewers