feat(generator): gapic generator centralization routing#17816
Open
hebaalazzeh wants to merge 6 commits into
Open
feat(generator): gapic generator centralization routing#17816hebaalazzeh wants to merge 6 commits into
hebaalazzeh wants to merge 6 commits into
Conversation
Contributor
There was a problem hiding this comment.
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
marked this pull request as ready for review
July 21, 2026 21:58
hebaalazzeh
force-pushed
the
feat/gapic-generator-centralization-routing
branch
from
July 21, 2026 23:14
b8ed069 to
b7054c2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) intogoogle/api_core/universe.py, we no longer need the generator to produce fallback implementations for them. The generated_compat.pywill now import these directly fromuniverse.py.(Note: This replaces the previous PR #17746 which was auto-closed due to a deleted base branch).