chore(generator): move setup_request_id into compat layer#17739
chore(generator): move setup_request_id into compat layer#17739hebaalazzeh wants to merge 100 commits into
setup_request_id into compat layer#17739Conversation
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
f25d768
Compare
a0bff77 to
613b392
Compare
f25d768 to
71b2f4e
Compare
e02ee4b to
db040bb
Compare
71b2f4e to
a8cc8d8
Compare
|
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 |
…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
76ac456
Compare
…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
20adea6
Compare
…erator assertions
|
To simplify things for myself and the review process I am going to break things down:
|
setup_request_id into compat layer
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.
…sion/%sub/_compat.py.j2 Co-authored-by: ohmayr <omairnaveed@ymail.com>
…e_%version/%sub/test_compat.py.j2 Co-authored-by: ohmayr <omairnaveed@ymail.com>
…e_%version/%sub/test_compat.py.j2 Co-authored-by: ohmayr <omairnaveed@ymail.com>
…sion/%sub/_compat.py.j2 Co-authored-by: ohmayr <omairnaveed@ymail.com>
…e_%version/%sub/test_compat.py.j2 Co-authored-by: ohmayr <omairnaveed@ymail.com>
…sion/%sub/_compat.py.j2 Co-authored-by: ohmayr <omairnaveed@ymail.com>
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