TidyLinker.com
TypeScript
Pull Request Opened
PR #172 opened: fix: derive Sentry release from git when SOURCE_COMMIT is absent
Why
PR #171 assumed Coolify auto-injects SOURCE_COMMIT at build time. It doesn't — that variable name comes from docker push hooks, not Coolify's Dockerfile build flow. The staging deploy that just landed picked up release: 'dev' (the fallback), so every event will still arrive tagged dev and won't match the sourcemaps the Vite plugin uploaded under whatever Sentry thinks the real release is.
I confirmed this by docker exec-ing into the new staging container and finding e.SENTRY_RELEASE={id:\"dev\"} baked into the bundle.
Fix
Resolve the release inside vite.config.ts with a 3-step chain:
SOURCE_COMMIT(still useful if a future CI sets it)git rev-parse --short=12 HEAD—.gitis present in the Docker frontend-build stage viaCOPY . .(no.dockerignorefilters it out) and present locally'dev'as a last-resort fallback
Uses execFileSync with a static argv (no shell, no interpolation — security skill flagged the original execSync call).
Verified
npm run buildlocally → bundle containstidylinker@57bd629905b2(matchesgit rev-parse --short=12 HEAD).SENTRY_API_TOKENis already on both staging and prod Coolify apps from earlier today, so the next build will upload sourcemaps bound to the real SHA.
Test plan
- Local smoke build → real SHA in bundle
- After merge: staging redeploys, inspect container, confirm
tidylinker@<sha>in bundle (notdev) - Sentry → Releases → confirm new release entry appears with uploaded artifacts
- Then prod deploy
+31
additions
-9
deletions
1
files changed