feat: delegate generated client boilerplate helpers to google-api-core#17706
feat: delegate generated client boilerplate helpers to google-api-core#17706hebaalazzeh wants to merge 38 commits into
Conversation
…rs.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…al client_helpers methods
Splits the monolithic client_helpers.py into routing.py, client_cert.py, config_helpers.py, and method_helpers.py to improve readability and maintainability. Updates gapic_v1 exports and test imports accordingly.
…and enable REST tests without grpc
…re_deps_from_source in noxfile
There was a problem hiding this comment.
Code Review
This pull request centralizes several GAPIC client helper methods (such as mTLS endpoint conversion, client certificate resolution, environment variable reading, universe domain resolution, and request ID setup) from the generated client templates into google-api-core under google.api_core.gapic_v1. The generated client templates are refactored to delegate to these centralized helpers, and their corresponding unit tests are moved from the generator templates to google-api-core. Additionally, dependencies in the generator are updated to point to the centralization branch of google-api-core, and test environments are isolated from workstation mTLS settings. I have no feedback to provide as there are no review comments.
Description
This draft PR updates the GAPIC generator templates to delegate common, service-agnostic boilerplate logic to the newly centralized functions in
google-api-core.gapic_v1.Related PR: #17628
Key Changes:
client.pyhave been updated so that boilerplate helper methods (such as_use_client_cert_effective,_get_api_endpoint, and_get_default_mtls_endpoint) now delegate their implementations to the centralizedapi-corefunctions (e.g.,_client_cert.use_client_cert_effective())._-prefixed methods from the generated clients entirely, we retain their definitions and signatures but delegate their logic. This ensures 100% backward compatibility for any existing code that might be monkey-patching or relying on these internal client methods.google-api-coredependency insetup.pyhas been temporarily pinned to thefeat/gapic-centralization-api-corebranch.Purpose of this Draft PR:
Running the showcase and unit tests against this draft PR will provide end-to-end integration verification that the
google-api-corecentralization branch works perfectly with generated code before we officially merge it.