Skip to content

fix: remove COMMIT_SHA from make deploy target#714

Merged
eliasecchig merged 2 commits intomainfrom
fix/remove-commit-sha-from-make-deploy
Jan 19, 2026
Merged

fix: remove COMMIT_SHA from make deploy target#714
eliasecchig merged 2 commits intomainfrom
fix/remove-commit-sha-from-make-deploy

Conversation

@eliasecchig
Copy link
Collaborator

@eliasecchig eliasecchig commented Jan 19, 2026

Summary

  • Remove COMMIT_SHA env var from make deploy target in both Python and Go Makefiles
  • Fix comma handling in Python Makefile for conditional env vars

Problem

COMMIT_SHA is an env var that gets used by ADK observability for versioning purposes e.g which version of the agent emitted that telemetry.

The make deploy command used git rev-parse HEAD to set COMMIT_SHA, which fails if the project hasn't been initialized as a git repo yet (e.g., when a user creates a project but hasn't run git init).

Solution

Since make deploy is intended for local development purposes, COMMIT_SHA tracking is not needed. CI/CD pipelines (Cloud Build and GitHub Actions) handle commit tracking separately via build args.

The telemetry code already has a fallback: os.environ.get("COMMIT_SHA", "dev"), so removing this from make deploy is safe.

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.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @eliasecchig, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the make deploy command across Python and Go project templates by eliminating the COMMIT_SHA environment variable. This change prevents deployment failures in environments where a Git repository hasn't been initialized, as COMMIT_SHA is primarily relevant for CI/CD pipelines and local deployments have a robust fallback mechanism. Additionally, it includes a fix for conditional comma placement within the Python Makefile's environment variable declarations, ensuring proper syntax.

Highlights

  • Removal of COMMIT_SHA from make deploy: The COMMIT_SHA environment variable, which relied on git rev-parse HEAD, has been removed from the make deploy target in both Python and Go Makefiles. This resolves issues when deploying projects not yet initialized as Git repositories.
  • Improved Conditional Environment Variable Handling: The Python Makefile now correctly handles comma placement for conditionally set environment variables, preventing syntax errors in the --update-env-vars argument.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

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 correctly removes the COMMIT_SHA environment variable from the make deploy targets in both the Go and Python Makefiles. This change prevents errors when running make deploy in a project that hasn't been initialized as a git repository. The accompanying fix for comma handling in the Python Makefile's conditional environment variables is also correct. I've included one suggestion to further refactor the Python Makefile for improved readability and maintainability.

@eliasecchig eliasecchig merged commit 80792ef into main Jan 19, 2026
34 checks passed
enriquekalven pushed a commit to enriquekalven/agent-starter-pack that referenced this pull request Feb 7, 2026
* 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.
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