Repository navigation
refactor(agentregistry): pass project_id and location as sample parameters - #15013
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors several ADK sample files and their corresponding tests by removing internal environment variable lookups for GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION. Instead, these values are now passed as parameters (project_id and location) to the sample functions. The review feedback consistently points out that, according to project guidelines, project_id should be kept as an explicit, required argument in sample code signatures without a default value (such as "PROJECT_ID") to ensure callers pass configuration directly rather than relying on implicit ADC resolution.
evelyn-goo
approved these changes
Dec 1, 2026
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.
Description
Fixes #15011
Moves
project_idandlocationfromos.environlookups into the sample function parameters across all Agent Registry ADK samples (aligning with the minimal-arguments guideline), and updates the pytest suites to pass them directly.Files updated
agentregistry/adk/auth_mcp_toolset.py&auth_mcp_toolset_test.pyagentregistry/adk/auth_remote_a2a_agent.py&auth_remote_a2a_agent_test.pyagentregistry/adk/clone_remote_agent.py&clone_remote_agent_test.pyagentregistry/adk/compose_multi_agent.py&compose_multi_agent_test.pyagentregistry/adk/deploy_agent_runtime.py&deploy_agent_runtime_test.pyagentregistry/adk/discover_agents_and_toolsets.py&discover_agents_and_toolsets_test.pyagentregistry/adk/mcp_custom_headers.py&mcp_custom_headers_test.pyagentregistry/adk/resolve_auth_bindings.py&resolve_auth_bindings_test.pyagentregistry/adk/resolve_auth_bindings_3lo.py&resolve_auth_bindings_3lo_test.pyChecklist
Testing
agentregistry.googleapis.comenablement and fixture setup in the shared test project.)Compliance & Style
Post-Approval Actions