Skip to content

chore: add commit sha to the sentry release - #300

Merged
spaenleh merged 1 commit into
mainfrom
sentry-release-sha
Oct 10, 2026
Merged

spaenleh merged 1 commit into
mainfrom
sentry-release-sha

Conversation

@spaenleh

Copy link
Copy Markdown
Member

The Sentry release came from the mix.exs version only, so every build between two release-please bumps reported the same release. For example, production reported 0.11.0 from 2026-06-30 to 2026-10-09 across several deploys, and every push to main reported the last released version.

  • config/prod.exs: release is <version>+<short sha> when GIT_SHA is set, otherwise the plain version
  • Dockerfile: ARG GIT_SHA just before RUN mix release, so a new commit only invalidates that layer. The Sentry SDK reads :release at runtime (no compile_env)
  • deploy.yaml: passes GIT_SHA=${{ github.sha }} as a build arg

Checked by evaluating config/prod.exs: "0.14.0" without GIT_SHA, "0.14.0+a05f09e" with it. Not yet checked with a real image build or deploy.

Side effect: development deploys create a separate Sentry release per push to main.

Builds between two version bumps all reported the same release, so
Sentry could not tell deploys apart. The deploy workflow now passes
GIT_SHA, giving releases like 0.14.0+a05f09e.
@spaenleh
spaenleh merged commit 0b8be65 into main Oct 10, 2026
2 checks passed
@spaenleh
spaenleh deleted the sentry-release-sha branch October 10, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant