Repository navigation
build(docker): Report the commit SHA as the Sentry release - #175
Merged
Merged
Conversation
Cloud Build passes COMMIT_SHA into the image as SENTRY_RELEASE, so the app's events carry the deployed commit instead of the Cloud Run revision name. Stop recording a production deploy in CI at merge time, since merging doesn't deploy. Co-Authored-By: Armen Zambrano Gasparnian <44410+armenzg@users.noreply.github.com>
armenzg
approved these changes
Nov 16, 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.
Right now the app never sets a Sentry release, so
sentry-sdkfalls back toK_REVISION, and events report the Cloud Run revision (for examplegithub-actions-app-00050-6tq). The revision name says nothing about which commit is running, so the only way to tell whethermainis deployed is to compare timestamps.With this change, Cloud Build passes
COMMIT_SHAinto the image asSENTRY_RELEASE. The running app then reports the exact commit SHA it was built from, no matter how the image gets deployed (console or otherwise). That SHA matches the releaseci.ymlalready creates, so the release's commits and suspect commits line up with what's actually live. Builds without the build arg, like the CIDocker buildjob and local builds, get an emptySENTRY_RELEASE, and the SDK falls back toK_REVISIONas before.This also drops
environment: productionfrom the CI release step. Before, it recorded a production deploy at merge time, even though merging doesn't deploy. Until there's a real deploy step, Sentry's first-seen time for the release is the deploy signal.To verify after merge: the Cloud Build trigger has to use
cloudbuild.yamlfor the build arg to take effect. After the next deploy, events insentry-github-actions-appshould carry a release equal to the deployed commit's full SHA.via @armenzg.
--
View Session [Sentry]