From f9d504635eb2ac141b5d357ab38c9c0ca33a6119 Mon Sep 17 00:00:00 2001 From: Jeevan Pillay <169354619+jeevanpillay@users.noreply.github.com> Date: Wed, 6 May 2026 16:39:21 +1000 Subject: [PATCH] fix(desktop): create Sentry release before finalize in upload script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #641 dropped the `sentry-cli releases new` step from the upload flow, assuming `sourcemaps upload --release X` would auto-create the release entity. It does not — it writes the artifact bundle and tags it with a release name, but the release record itself stays absent. The subsequent `releases finalize` then errors with "Release not found" and the workflow fails after every sourcemap has already uploaded. Restore `sentry-cli releases new ` as the first step. The full flow is now: new -> upload (main) -> upload (renderer) -> finalize. Failed run that surfaced this: https://github.com/lightfastai/lightfast/actions/runs/25420266590 Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/desktop/scripts/upload-sourcemaps.mjs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/desktop/scripts/upload-sourcemaps.mjs b/apps/desktop/scripts/upload-sourcemaps.mjs index 67afb0ce5..42856c9f7 100755 --- a/apps/desktop/scripts/upload-sourcemaps.mjs +++ b/apps/desktop/scripts/upload-sourcemaps.mjs @@ -38,11 +38,16 @@ function sentry(args) { } // Modern artifact-bundle flow with debug-id matching. `sourcemaps inject` -// runs in `forge.config.ts`'s prePackage hook so the injected //# debugId= -// comments land in the asar; here we only `upload`. Stack frames in Sentry -// resolve via debug-id, which avoids URL-prefix mismatches between the -// uploaded path (`assets/index-*.js`) and the runtime frame +// runs in `forge.config.ts`'s `packageAfterCopy` hook so the injected +// //# debugId= comments land in the asar; here we only `upload`. Stack +// frames in Sentry resolve via debug-id, sidestepping URL-prefix mismatches +// between the uploaded path (`assets/index-*.js`) and the runtime frame // (`app:///.vite/renderer/main_window/assets/index-*.js`). +// +// `sourcemaps upload --release` writes the artifact bundle but does NOT +// create the release entity. `releases new` is required before finalize, +// otherwise finalize errors with "Release not found". +sentry(["releases", "new", release]); sentry(["sourcemaps", "upload", "--release", release, buildDir]); sentry(["sourcemaps", "upload", "--release", release, rendererDir]); sentry(["releases", "finalize", release]);