Skip to content

feat(generator): gapic generator centralization routing#17816

Open
hebaalazzeh wants to merge 6 commits into
mainfrom
feat/gapic-generator-centralization-routing
Open

feat(generator): gapic generator centralization routing#17816
hebaalazzeh wants to merge 6 commits into
mainfrom
feat/gapic-generator-centralization-routing

Conversation

@hebaalazzeh

@hebaalazzeh hebaalazzeh commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

This PR updates the generator templates to rely on the centralized endpoint routing and universe domain logic from google-api-core.

Since PR #17799 successfully centralized these helpers (get_api_endpoint, get_universe_domain, get_default_mtls_endpoint) into google/api_core/universe.py, we no longer need the generator to produce fallback implementations for them. The generated _compat.py will now import these directly from universe.py.

(Note: This replaces the previous PR #17746 which was auto-closed due to a deleted base branch).

@hebaalazzeh hebaalazzeh self-assigned this Jul 21, 2026

@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 introduces a new compatibility template _compat.py.j2 to provide fallback implementations for get_default_mtls_endpoint, get_api_endpoint, and get_universe_domain when they are not available in google.api_core.universe. The client templates are updated to delegate these operations to the new compatibility module, and redundant unit tests are removed from the generated test suites. The review feedback highlights that both get_api_endpoint in _compat.py.j2 and _get_api_endpoint in client.py.j2 can return None under certain conditions, and recommends updating their return type annotations to Optional[str] for better type safety.

@hebaalazzeh
hebaalazzeh marked this pull request as ready for review July 21, 2026 21:58
@hebaalazzeh
hebaalazzeh requested a review from a team as a code owner July 21, 2026 21:58
@hebaalazzeh
hebaalazzeh force-pushed the feat/gapic-generator-centralization-routing branch from b8ed069 to b7054c2 Compare July 21, 2026 23:14
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