From cdeca53642fae68ee23b2d3fa4baeecfaa8c3684 Mon Sep 17 00:00:00 2001 From: Elia Date: Mon, 19 Jan 2026 19:48:28 +0100 Subject: [PATCH 1/2] fix: remove COMMIT_SHA from make deploy target The deploy Makefile target used `git rev-parse HEAD` to set COMMIT_SHA, which fails if the project hasn't been initialized as a git repo yet. Since `make deploy` is intended for local development, COMMIT_SHA is not needed. CI/CD pipelines handle commit tracking separately. The telemetry code already defaults to "dev" when COMMIT_SHA is unset. --- agent_starter_pack/base_templates/go/Makefile | 2 +- agent_starter_pack/base_templates/python/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/agent_starter_pack/base_templates/go/Makefile b/agent_starter_pack/base_templates/go/Makefile index ad1f7903..4aca8b6c 100644 --- a/agent_starter_pack/base_templates/go/Makefile +++ b/agent_starter_pack/base_templates/go/Makefile @@ -78,7 +78,7 @@ deploy: --no-allow-unauthenticated \ --no-cpu-throttling \ --labels "created-by=adk" \ - --update-env-vars "GOOGLE_CLOUD_PROJECT=$$PROJECT_ID,GOOGLE_CLOUD_LOCATION=global,GOOGLE_GENAI_USE_VERTEXAI=True,COMMIT_SHA=$(shell git rev-parse HEAD),APP_URL=https://{{cookiecutter.project_name}}-$$PROJECT_NUMBER.us-central1.run.app" \ + --update-env-vars "GOOGLE_CLOUD_PROJECT=$$PROJECT_ID,GOOGLE_CLOUD_LOCATION=global,GOOGLE_GENAI_USE_VERTEXAI=True,APP_URL=https://{{cookiecutter.project_name}}-$$PROJECT_NUMBER.us-central1.run.app" \ $(if $(IAP),--iap) \ $(if $(PORT),--port=$(PORT)) diff --git a/agent_starter_pack/base_templates/python/Makefile b/agent_starter_pack/base_templates/python/Makefile index 86b9fab6..a72e266a 100644 --- a/agent_starter_pack/base_templates/python/Makefile +++ b/agent_starter_pack/base_templates/python/Makefile @@ -280,7 +280,7 @@ deploy: --labels "{% if cookiecutter.is_adk %}created-by=adk{% if cookiecutter.agent_garden %},{% endif %}{% endif %}{% if cookiecutter.agent_garden %}deployed-with=agent-garden{% if cookiecutter.agent_sample_id %},vertex-agent-sample-id={{cookiecutter.agent_sample_id}},vertex-agent-sample-publisher={{cookiecutter.agent_sample_publisher}}{% endif %}{% endif %}" \ --update-build-env-vars "AGENT_VERSION=$(shell awk -F'"' '/^version = / {print $$2}' pyproject.toml || echo '0.0.0')" \ --update-env-vars \ - "COMMIT_SHA=$(shell git rev-parse HEAD){%- if cookiecutter.is_a2a %},APP_URL=https://{{cookiecutter.project_name}}-$$PROJECT_NUMBER.us-central1.run.app{%- endif %}{%- if cookiecutter.data_ingestion %}{%- if cookiecutter.datastore_type == "vertex_ai_search" %},DATA_STORE_ID={{cookiecutter.project_name}}-datastore,DATA_STORE_REGION=us{%- elif cookiecutter.datastore_type == "vertex_ai_vector_search" %},VECTOR_SEARCH_INDEX={{cookiecutter.project_name}}-vector-search,VECTOR_SEARCH_INDEX_ENDPOINT={{cookiecutter.project_name}}-vector-search-endpoint,VECTOR_SEARCH_BUCKET=$$PROJECT_ID-{{cookiecutter.project_name}}-vs{%- endif %}{%- endif %}" \ + "{%- if cookiecutter.is_a2a %}APP_URL=https://{{cookiecutter.project_name}}-$$PROJECT_NUMBER.us-central1.run.app{%- endif %}{%- if cookiecutter.data_ingestion %}{%- if cookiecutter.datastore_type == "vertex_ai_search" %}{% if cookiecutter.is_a2a %},{% endif %}DATA_STORE_ID={{cookiecutter.project_name}}-datastore,DATA_STORE_REGION=us{%- elif cookiecutter.datastore_type == "vertex_ai_vector_search" %}{% if cookiecutter.is_a2a %},{% endif %}VECTOR_SEARCH_INDEX={{cookiecutter.project_name}}-vector-search,VECTOR_SEARCH_INDEX_ENDPOINT={{cookiecutter.project_name}}-vector-search-endpoint,VECTOR_SEARCH_BUCKET=$$PROJECT_ID-{{cookiecutter.project_name}}-vs{%- endif %}{%- endif %}" \ $(if $(IAP),--iap) \ $(if $(PORT),--port=$(PORT)) {%- elif cookiecutter.deployment_target == 'agent_engine' %} From f7215a9159cbc08c93fadc47750c861ad557fe91 Mon Sep 17 00:00:00 2001 From: Elia Date: Mon, 19 Jan 2026 19:53:41 +0100 Subject: [PATCH 2/2] refactor: deduplicate conditional comma logic --- agent_starter_pack/base_templates/python/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent_starter_pack/base_templates/python/Makefile b/agent_starter_pack/base_templates/python/Makefile index a72e266a..2d841b3e 100644 --- a/agent_starter_pack/base_templates/python/Makefile +++ b/agent_starter_pack/base_templates/python/Makefile @@ -280,7 +280,7 @@ deploy: --labels "{% if cookiecutter.is_adk %}created-by=adk{% if cookiecutter.agent_garden %},{% endif %}{% endif %}{% if cookiecutter.agent_garden %}deployed-with=agent-garden{% if cookiecutter.agent_sample_id %},vertex-agent-sample-id={{cookiecutter.agent_sample_id}},vertex-agent-sample-publisher={{cookiecutter.agent_sample_publisher}}{% endif %}{% endif %}" \ --update-build-env-vars "AGENT_VERSION=$(shell awk -F'"' '/^version = / {print $$2}' pyproject.toml || echo '0.0.0')" \ --update-env-vars \ - "{%- if cookiecutter.is_a2a %}APP_URL=https://{{cookiecutter.project_name}}-$$PROJECT_NUMBER.us-central1.run.app{%- endif %}{%- if cookiecutter.data_ingestion %}{%- if cookiecutter.datastore_type == "vertex_ai_search" %}{% if cookiecutter.is_a2a %},{% endif %}DATA_STORE_ID={{cookiecutter.project_name}}-datastore,DATA_STORE_REGION=us{%- elif cookiecutter.datastore_type == "vertex_ai_vector_search" %}{% if cookiecutter.is_a2a %},{% endif %}VECTOR_SEARCH_INDEX={{cookiecutter.project_name}}-vector-search,VECTOR_SEARCH_INDEX_ENDPOINT={{cookiecutter.project_name}}-vector-search-endpoint,VECTOR_SEARCH_BUCKET=$$PROJECT_ID-{{cookiecutter.project_name}}-vs{%- endif %}{%- endif %}" \ + "{%- if cookiecutter.is_a2a %}APP_URL=https://{{cookiecutter.project_name}}-$$PROJECT_NUMBER.us-central1.run.app{%- endif %}{%- if cookiecutter.data_ingestion %}{% if cookiecutter.is_a2a %},{% endif %}{%- if cookiecutter.datastore_type == "vertex_ai_search" %}DATA_STORE_ID={{cookiecutter.project_name}}-datastore,DATA_STORE_REGION=us{%- elif cookiecutter.datastore_type == "vertex_ai_vector_search" %}VECTOR_SEARCH_INDEX={{cookiecutter.project_name}}-vector-search,VECTOR_SEARCH_INDEX_ENDPOINT={{cookiecutter.project_name}}-vector-search-endpoint,VECTOR_SEARCH_BUCKET=$$PROJECT_ID-{{cookiecutter.project_name}}-vs{%- endif %}{%- endif %}" \ $(if $(IAP),--iap) \ $(if $(PORT),--port=$(PORT)) {%- elif cookiecutter.deployment_target == 'agent_engine' %}