chore(api_core): move request-id auto-population logic to gapic_v1 public helpers#17738
chore(api_core): move request-id auto-population logic to gapic_v1 public helpers#17738hebaalazzeh wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new helper module method_helpers containing a setup_request_id function to populate a UUID4 field in requests if not already set, supporting dicts, protobuf, and proto-plus messages. It also adds a session-scoped pytest fixture to isolate unit tests from workstation mTLS environments, updates a nox session configuration, and relaxes a timing assertion in test_bidi.py. As there are no review comments, no additional feedback is provided.
a0bff77 to
613b392
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new helper module method_helpers containing the setup_request_id function, which populates a UUID4 field in request objects or dictionaries if not already set, along with corresponding unit tests. The review feedback suggests adding a None check at the beginning of setup_request_id and using a default value in getattr to prevent potential AttributeErrors, as well as adding a test case to verify graceful handling of None requests.
e02ee4b to
db040bb
Compare
…lic helpers Introduces method_helpers module containing setup_request_id helper. Exposes the module as public in gapic_v1.
…t and improve docstring
8e31d83 to
20adea6
Compare
Introduces
requestmodule containingsetup_request_idhelper. Exposes the module as public ingapic_v1.The unit tests in test_method_helpers.py are now identical to the generator's original test template test_service.py.j2 (with the exception of our added None request test case).