Skip to content

chore(generator): gapic generator centralization mtls#17749

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

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

Conversation

@hebaalazzeh

@hebaalazzeh hebaalazzeh commented Jul 16, 2026

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.

Associated / Dependent API Core PR: #17750

@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
@hebaalazzeh
hebaalazzeh force-pushed the feat/gapic-centralization-api-core-mtls branch 4 times, most recently from 58a8230 to d392678 Compare July 21, 2026 14:28
@hebaalazzeh hebaalazzeh reopened this Jul 21, 2026
@hebaalazzeh
hebaalazzeh force-pushed the feat/gapic-centralization-api-core-mtls branch from f5cd957 to 10e7f4f Compare July 21, 2026 16:18
@hebaalazzeh
hebaalazzeh force-pushed the feat/gapic-generator-centralization-mtls branch from d3aa84f to b47cd25 Compare July 21, 2026 16:31
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