Uh oh!
There was an error while loading. Please reload this page.
chore(generator): move setup_request_id into compat layer - #17739
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the request ID setup logic in the generated client templates by delegating it to google.api_core.gapic_v1.method_helpers.setup_request_id instead of maintaining an inline implementation. As a result, the redundant unit tests for _setup_request_id have been removed from both the templates and the golden integration tests. There are no review comments, so I have no feedback to provide.
f037044 to
f25d768Comparea0bff77 to
613b392Comparef25d768 to
71b2f4eComparee02ee4b to
db040bbCompare71b2f4e to
a8cc8d8Comparedaniel-sanche
commented
Jul 16, 2026
This implementation makes sense if we plan to bump up the api_core requirement Before merging, we need to:
There's also a chance we will want to keep a fallback implementation to keep supporting old api_core versions |
Uh oh!
There was an error while loading. Please reload this page.
…lic helpers Introduces method_helpers module containing setup_request_id helper. Exposes the module as public in gapic_v1.
…t and improve docstring
90602cc to
76ac456Compare…lic helpers Introduces method_helpers module containing setup_request_id helper. Exposes the module as public in gapic_v1.
Updates generator templates and goldens to import public method_helpers from google-api-core gapic_v1 and call setup_request_id helper. Removes duplicate setup_request_id test logic from generated client unit tests.
…t and improve docstring
8e31d83 to
20adea6CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
hebaalazzeh
commented
Jul 23, 2026
To simplify things for myself and the review process I am going to break things down:
|
setup_request_id into compat layerUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
@hebaalazzeh I've added some suggestions for generating these methods conditionally. This'll avoid generating these helper methods in libraries which don't need them.
You can regenerate the goldens and you shouldn't see a diff in any of them except storagebatchoperations which has auto populated fields. PTAL.
feafc85 to
b24ca28Compareb045d57 to
aa6c6b7CompareUh oh!
There was an error while loading. Please reload this page.
Moves
setup_request_iddefined in the client template into_compat.py.j2and the related test cases fromtest_%service.py.j2totest_compat.py.j2Associated / Dependent API Core PR: #17738
Towards: #17883