fix: remove COMMIT_SHA from make deploy target#714
Conversation
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.
Summary of ChangesHello @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 Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
* 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.
Summary
COMMIT_SHAenv var frommake deploytarget in both Python and Go MakefilesProblem
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 deploycommand usedgit rev-parse HEADto setCOMMIT_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 rungit init).Solution
Since
make deployis intended for local development purposes,COMMIT_SHAtracking 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 frommake deployis safe.