Skip to content

chore(generator): gapic generator centralization mtls#17749

Draft
hebaalazzeh wants to merge 4 commits into
feat/gapic-centralization-api-core-mtlsfrom
feat/gapic-generator-centralization-mtls
Draft

chore(generator): gapic generator centralization mtls#17749
hebaalazzeh wants to merge 4 commits into
feat/gapic-centralization-api-core-mtlsfrom
feat/gapic-generator-centralization-mtls

Conversation

@hebaalazzeh

Copy link
Copy Markdown
Contributor

Updates client templates to delegate _use_client_cert_effective, _read_environment_variables, and _get_client_cert_source to public client_cert and config_helpers modules in google-api-core gapic_v1. Removes redundant unit tests from templates and regenerates golden files.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors client certificate handling and environment variable parsing by extracting common logic from the GAPIC client template into centralized helper modules (client_cert.py and config_helpers.py) in google-api-core. This change simplifies the generated client code and eliminates redundant unit tests across multiple services. Feedback on the changes suggests a more robust mocking approach in the new unit tests, specifically recommending mocking the mtls module with an empty spec instead of patching the built-in hasattr function.

Comment thread packages/google-api-core/tests/unit/gapic/test_client_cert.py Outdated
@hebaalazzeh
hebaalazzeh force-pushed the feat/gapic-generator-centralization-mtls branch from a23e10d to 5cc1bec Compare July 16, 2026 21:49
@hebaalazzeh
hebaalazzeh changed the base branch from main to feat/gapic-centralization-api-core-mtls July 16, 2026 21:54
@hebaalazzeh hebaalazzeh self-assigned this Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant