Repository navigation
ref(core): Share the commit env var list used for release detection - #25478
Draft
mwarkentin wants to merge 1 commit into
Draft
mwarkentin wants to merge 1 commit into
mwarkentin wants to merge 1 commit into
Conversation
The Node SDK, the Vercel Edge SDK and the bundler plugins each kept their own copy of the commit environment variables they read to detect a release, along with their own placeholder check. The copies had already drifted: the bundler plugins did not read HEROKU_BUILD_COMMIT. The list and the placeholder check now live in @sentry/core/server as getReleaseFromCommitEnv() and readCommitEnvVar(). Node and Vercel Edge keep their SENTRY_RELEASE and injected-release checks, and the bundler plugins keep their git fallback and their own once-per-build warning. The bundler plugins now also read HEROKU_BUILD_COMMIT. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WgDm3ijhQZQUHGAFFqQzKQ
Contributor
size-limit report 📦
|
This branch has not been deployed
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.
Follow-up to #25244, as suggested in review there.
The Node SDK, the Vercel Edge SDK and the bundler plugins each kept their own copy of the commit environment variables they read to detect a release, plus their own copy of the placeholder check added in #25244. The copies had already drifted: the bundler plugins did not read
HEROKU_BUILD_COMMIT.Changes
packages/core/src/utils/commitEnv.ts, exported from@sentry/core/server:readCommitEnvVar(name, onPlaceholder?)ignores a value that is its own name. By default it warns throughconsoleSandboxwith the[Sentry]prefix;getReleaseFromCommitEnv(onPlaceholder?)returns the first variable that is set. It reads in order and stops at the first match, so a placeholder is only reported when it would otherwise have become the release.getSentryRelease()keeps theSENTRY_RELEASEand injected-release checks, then callsgetReleaseFromCommitEnv().determineReleaseName()callsgetReleaseFromCommitEnv(), then falls back togit rev-parseas before. It passes its own handler, which keeps the[@sentry/bundler-plugins]prefix and warns once per variable per build.readCommitEnvVarkeeps its signature, sosetCommitsis unchanged.Behaviour change: the bundler plugins now read
HEROKU_BUILD_COMMIT, ahead ofHEROKU_SLUG_COMMIT, as Node and Vercel Edge already do. Nothing else changes order or meaning.Testing
packages/core/test/lib/utils/commitEnv.test.tscovers:HEROKU_BUILD_COMMITbeforeHEROKU_SLUG_COMMIT;HEROKU_BUILD_COMMIT.Before submitting a pull request, please take a look at our
Contributing guidelines and verify:
yarn lint) & (yarn test).Generated by Claude Code