Skip to content

fix(build): do not run the Sentry release upload as a root postbuild hook - #1464

Open
Chirag6722 wants to merge 1 commit into
supermemoryai:mainfrom
Chirag6722:fix/remove-root-sentry-postbuild
Open

fix(build): do not run the Sentry release upload as a root postbuild hook#1464
Chirag6722 wants to merge 1 commit into
supermemoryai:mainfrom
Chirag6722:fix/remove-root-sentry-postbuild

Conversation

@Chirag6722

Copy link
Copy Markdown

Fixes #1444.

The root package.json had:

"build": "turbo run build",
"sentry:sourcemaps": "... sentry-cli releases new ... sentry-cli sourcemaps upload ... dist",
"postbuild": "bun run sentry:sourcemaps"

so every bun run build — local or CI — chained a Sentry release creation and sourcemap upload onto the build. That needs deploy-only credentials to succeed, and it targets a root dist/ that the Turbo build doesn't produce (apps/web emits .next).

Change

Remove the root postbuild hook. Nothing else moves:

  • sentry:sourcemaps stays at the root as an explicit, manually-invocable command.
  • The real release path is untouched — apps/web already carries its own identical sentry:sourcemaps plus "postdeploy": "bun run sentry:sourcemaps", which fires on deploy, after the app build, which is where it belongs.

That last point is why this is a safe deletion rather than a behaviour change: the root hook was a duplicate of the web app's, firing at build time instead of deploy time.

Acceptance criteria

  • bun run build succeeds without SENTRY_AUTH_TOKEN — verified: 7 successful, 7 total, exit 0, with no Sentry configuration present.
  • No Sentry release/upload attempted during ordinary builds — verified: no sentry-cli invocation in the build output. (The [@sentry/nextjs] deprecation warnings that remain come from the Next.js build plugin, not the CLI upload.)
  • Production deployment still creates the release — unchanged; it runs from apps/web's postdeploy.

I did not run the pre-change build to demonstrate the failure, because with credentials present that command creates a real release in the supermemory org — not something to trigger from a contributor's machine.

Left alone

#1444 also suggests correcting the dist path / --strip-prefix and replacing the POSIX _SENTRY_RELEASE=$(...) syntax with something cross-platform. Both apply to the apps/web deploy command and depend on how your deploy pipeline is wired, which I can't see from here — so this PR sticks to removing the hook. Happy to follow up on either if you say what the deployed output layout is.

…hook

The root `postbuild` hook ran `sentry:sourcemaps` after every
`bun run build`, so an ordinary build required Sentry credentials and
tried to upload a root-level `dist/` directory that the Turbo build never
produces.

Drop the hook. `sentry:sourcemaps` stays as an explicit command, and
apps/web already owns the deployment path for it via its own
`sentry:sourcemaps` plus a `postdeploy` hook, so releases are unaffected.

Fixes supermemoryai#1444
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(build): do not run Sentry release upload as a root postbuild hook

1 participant