Skip to content

refactor(agentregistry): pass project_id and location as sample parameters - #15013

Merged
fatoboist merged 1 commit into
mainfrom
fix/agentregistry-project-id-params
Dec 1, 2026
Merged

fatoboist merged 1 commit into
mainfrom
fix/agentregistry-project-id-params

Conversation

@fatoboist

Copy link
Copy Markdown
Contributor

Description

Fixes #15011

Moves project_id and location from os.environ lookups 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.py
  • agentregistry/adk/auth_remote_a2a_agent.py & auth_remote_a2a_agent_test.py
  • agentregistry/adk/clone_remote_agent.py & clone_remote_agent_test.py
  • agentregistry/adk/compose_multi_agent.py & compose_multi_agent_test.py
  • agentregistry/adk/deploy_agent_runtime.py & deploy_agent_runtime_test.py
  • agentregistry/adk/discover_agents_and_toolsets.py & discover_agents_and_toolsets_test.py
  • agentregistry/adk/mcp_custom_headers.py & mcp_custom_headers_test.py
  • agentregistry/adk/resolve_auth_bindings.py & resolve_auth_bindings_test.py
  • agentregistry/adk/resolve_auth_bindings_3lo.py & resolve_auth_bindings_3lo_test.py

Checklist

Testing

  • I have tested this change on a live environment and verified it works as intended. (Pending agentregistry.googleapis.com enablement and fixture setup in the shared test project.)

Compliance & Style


Post-Approval Actions

  • Please merge this PR for me once it is approved

@fatoboist
fatoboist requested review from a team as code owners December 1, 2026 19:29
@product-auto-label product-auto-label Bot added api: agentregistry Issues related to the Agent Registry API. samples Issues that are directly related to samples. labels Dec 1, 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 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.

Comment thread agentregistry/adk/auth_mcp_toolset.py Resolved
Comment thread agentregistry/adk/clone_remote_agent.py Resolved
Comment thread agentregistry/adk/mcp_custom_headers.py Resolved
@fatoboist
fatoboist merged commit 1831af8 into main Dec 1, 2026
14 of 19 checks passed
@fatoboist
fatoboist deleted the fix/agentregistry-project-id-params branch December 1, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: agentregistry Issues related to the Agent Registry API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate moving Project ID to sample function params in Agent Registry

2 participants