Repository navigation
ci(release): publish main-process source maps with each release - #17630
Conversation
Desktop bundles ship minified, and packaging drops out/**/*.map from app.asar, so a stack trace from a released build cannot be mapped back to source. main builds with sourcemap:'hidden' — the maps exist in CI but were never published anywhere. Zip them on the linux-x64 leg and upload to the draft release as orca-sourcemaps-<tag>.zip (33.7MB raw, ~8MB zipped, 69 files). The main bundle is platform-independent, so one leg covers the whole release. The step fails loudly if no maps are found, so a regression of build.sourcemap breaks the release instead of silently shipping undecodable builds.
Greptile SummaryThis PR publishes main-process source maps alongside each release so maintainers can decode stack traces from minified desktop builds.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| .github/workflows/release-cut.yml | Adds single-leg source-map validation, archiving outside the checkout, and draft-release upload before Linux artifact publication. |
| config/scripts/release-cut-sourcemap-publish.test.mjs | Adds contract coverage for source-map publication gating, staging location, fail-loud behavior, and workflow ordering. |
Sequence Diagram
sequenceDiagram
participant B as Linux x64 build
participant T as Runner temporary directory
participant R as Draft GitHub release
B->>B: Build app and emit hidden source maps
B->>B: Verify out/main contains .js.map files
B->>T: Create orca-sourcemaps-tag.zip
T->>R: Upload source-map archive
B->>B: Package and publish Linux artifacts
Reviews (4): Last reviewed commit: "Merge branch 'main' into nwparker/releas..." | Re-trigger Greptile
Every entry in electron-builder's `files` is a negation, so app-builder hits containsOnlyIgnore() and prepends `**/*` (fileMatcher.js:285). A zip left in the workspace root would have been packed into the linux-x64 app.asar, growing that platform's installers by ~8MB and diverging them from arm64 — the same hazard the '!pr-evidence' exclusion already guards against. Stage it in $RUNNER_TEMP, matching the release-state file at :444.
📝 WalkthroughWalkthroughThe release workflow adds Linux x64 steps that fail when main-process source maps are absent, archive emitted Merge Risk: 🔵 Low · up to This adds a release-only source-map archive and fails releases when maps are missing without changing the installed app. The PR is mergeable with explicit owner awareness that 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the problem, implementation, rationale, verification, scope, and merge dependency. It does not follow the repository template and omits the required linked issue, explicit Visual Proof entry, testing checklist, AI Disclosure, Review, boundary, Notes, and final Checklist sections. Resolution Reformat the description using all required template headings. Add a valid linked issue reference, write Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 88abb393-7187-47da-ac16-91ad0f96d552
📒 Files selected for processing (2)
.github/workflows/release-cut.ymlconfig/scripts/release-cut-sourcemap-publish.test.mjs
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.
| expect(bundle.run).toContain("find out/main -name '*.js.map'") | ||
| expect(publish.with.command).toContain('gh release upload') | ||
| expect(publish.with.command).toContain('orca-sourcemaps-') |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Strengthen the source-map publication contract assertions.
Assert that each source-map step appears exactly once, that archive creation uses orca-sourcemaps-$TAG.zip, and that the upload references the same tag-specific archive. This prevents duplicate workflow steps or mismatched archive paths from passing the contract test.
📍 Affects 1 file
config/scripts/release-cut-sourcemap-publish.test.mjs#L26-L28(this comment)config/scripts/release-cut-sourcemap-publish.test.mjs#L16-L17
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 591b4366-7aaf-436d-8af4-88c16bb9568a
📒 Files selected for processing (2)
.github/workflows/release-cut.ymlconfig/scripts/release-cut-sourcemap-publish.test.mjs
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.
| // Why: the main bundle is platform-independent, so duplicating the ~8MB | ||
| // artifact across legs would only race the uploads against each other. | ||
| for (const step of [bundle, publish]) { | ||
| expect(step.if).toContain('linux-x64') |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Require an exact linux-x64 gate.
toContain('linux-x64') also accepts a condition that includes linux-arm64. The test would then pass after source maps are uploaded by multiple platform legs. Compare the complete if expression.
Proposed test fix
for (const step of [bundle, publish]) {
- expect(step.if).toContain('linux-x64')
+ expect(step.if).toBe("matrix.platform == 'linux-x64'")
}| expect(stepIndex('Publish main-process source maps')).toBeGreaterThan(bundle) | ||
| expect(bundle).toBeLessThan(stepIndex('Publish release artifacts (Linux)')) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Assert publication before Linux artifact upload.
The current test does not prove that Publish main-process source maps runs before Publish release artifacts (Linux). A future move of the upload step after artifact publication would pass this test.
Add an assertion that the source-map publication index is less than the Linux artifact publication index.
Proposed test fix
const bundle = stepIndex('Bundle main-process source maps')
+const publish = stepIndex('Publish main-process source maps')
expect(bundle).toBeGreaterThan(stepIndex('Build app'))
-expect(stepIndex('Publish main-process source maps')).toBeGreaterThan(bundle)
+expect(publish).toBeGreaterThan(bundle)
+expect(publish).toBeLessThan(stepIndex('Publish release artifacts (Linux)'))
expect(bundle).toBeLessThan(stepIndex('Publish release artifacts (Linux)'))There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Bundle step — on the
linux-x64leg, fail-loud ifout/mainhas no.js.mapfiles, then zip them intoorca-sourcemaps-<tag>.zip. - Publish step — retry-wrapped
gh release uploadof the zip to the draft release, reusing the job'scontents: writepermission. - Contract test — pins single-leg gating, the fail-loud guard, and ordering relative to
Build app/Publish release artifacts (Linux).
ℹ️ Merge-order dependency on #17527
This PR is correct on its own but does not stand alone: the find out/main -name '*.js.map' guard only passes once #17527 lands (it adds sourcemap: 'hidden' to the main build and the !out/**/*.map packaging exclusion). #17527 is still open, so this must merge after it or the next release cut fails loudly at the bundle step. The author documented this in the PR body; flagging only so the merge ordering is enforced. The fail-loud behavior itself is the right design — a regression of sourcemap should break the release rather than ship undecodable builds.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes (delta since prior pullfrog review)
- Bundle step stages outside the checkout — the zip now lands in
$RUNNER_TEMPinstead of the workspace root, so electron-builder's**/*default (allfilesentries are negations) cannot pack the 8 MB zip intoapp.asar. - Publish step tracks the new location — uploads from
${{ runner.temp }}, which matches$RUNNER_TEMPon GitHub-hosted runners. - Contract test — adds an out-of-checkout staging assertion and reworks step lookup into a
stepIndexhelper.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…17641) `serializes FETCH_HEAD callers before they enter admission` assumed that two same-repo fetches join the FETCH_HEAD lock lane in call order. They do not. `runWithGitFetchHeadLock` first `await`s `fetchLockPath`, which walks the filesystem (`realpath`, `stat` per parent directory, `readFile` of `commondir`, `realpath` again) before it calls `runWithGitOperationLock`, and the lane is registered only after that walk resolves. For a non-existent `/repo` that is five libuv threadpool round-trips per caller. Two callers issued back to back run their chains concurrently, so lane order is threadpool completion order, not call order. When the `interactive` fetch won that race it entered the lane ahead of the `background` fetch. On the first caller's release it reached admission immediately and, being interactive, took the free network headroom slot instead of queueing, while the background fetch stayed parked on the lock. `queued` therefore settled at 0 and never reached the asserted 1. Measured inversion rate for the bare lock-path walk was 54/500 on an idle machine; the test itself failed 5/20 locally, always at the same assertion, matching the two CI failures on unrelated PRs (#17530, #17630) at the same line. Fix the premise rather than the symptom: stub only the key derivation, keeping the real FIFO `runWithGitOperationLock` that the test actually exercises, so the lane is registered synchronously with the call. Key derivation keeps its own coverage in `src/shared/git-fetch-head-lock.test.ts`. This also stops the fetch tests in this file from sharing one global `/.git/FETCH_HEAD` lane with each other and from touching the real filesystem. Verified deterministic: 40/40, then 30/30 clean runs, plus 25/25 with twelve CPU hogs and a concurrent `src/main/git/command-runner/` run saturating the box.
…lyai#17630) * ci(release): publish main-process source maps with each release Desktop bundles ship minified, and packaging drops out/**/*.map from app.asar, so a stack trace from a released build cannot be mapped back to source. main builds with sourcemap:'hidden' — the maps exist in CI but were never published anywhere. Zip them on the linux-x64 leg and upload to the draft release as orca-sourcemaps-<tag>.zip (33.7MB raw, ~8MB zipped, 69 files). The main bundle is platform-independent, so one leg covers the whole release. The step fails loudly if no maps are found, so a regression of build.sourcemap breaks the release instead of silently shipping undecodable builds. * fix(release): stage source map bundle outside the checkout Every entry in electron-builder's `files` is a negation, so app-builder hits containsOnlyIgnore() and prepends `**/*` (fileMatcher.js:285). A zip left in the workspace root would have been packed into the linux-x64 app.asar, growing that platform's installers by ~8MB and diverging them from arm64 — the same hazard the '!pr-evidence' exclusion already guards against. Stage it in $RUNNER_TEMP, matching the release-state file at :444.
…tablyai#17641) `serializes FETCH_HEAD callers before they enter admission` assumed that two same-repo fetches join the FETCH_HEAD lock lane in call order. They do not. `runWithGitFetchHeadLock` first `await`s `fetchLockPath`, which walks the filesystem (`realpath`, `stat` per parent directory, `readFile` of `commondir`, `realpath` again) before it calls `runWithGitOperationLock`, and the lane is registered only after that walk resolves. For a non-existent `/repo` that is five libuv threadpool round-trips per caller. Two callers issued back to back run their chains concurrently, so lane order is threadpool completion order, not call order. When the `interactive` fetch won that race it entered the lane ahead of the `background` fetch. On the first caller's release it reached admission immediately and, being interactive, took the free network headroom slot instead of queueing, while the background fetch stayed parked on the lock. `queued` therefore settled at 0 and never reached the asserted 1. Measured inversion rate for the bare lock-path walk was 54/500 on an idle machine; the test itself failed 5/20 locally, always at the same assertion, matching the two CI failures on unrelated PRs (stablyai#17530, stablyai#17630) at the same line. Fix the premise rather than the symptom: stub only the key derivation, keeping the real FIFO `runWithGitOperationLock` that the test actually exercises, so the lane is registered synchronously with the call. Key derivation keeps its own coverage in `src/shared/git-fetch-head-lock.test.ts`. This also stops the fetch tests in this file from sharing one global `/.git/FETCH_HEAD` lane with each other and from touching the real filesystem. Verified deterministic: 40/40, then 30/30 clean runs, plus 25/25 with twelve CPU hogs and a concurrent `src/main/git/command-runner/` run saturating the box.

Problem
Desktop bundles ship minified, and packaging drops
out/**/*.mapfromapp.asar— so a stack trace from a released build cannot be mapped back to source.There is no third-party crash service to symbolicate for us:
crashReporterruns withuploadToServer: false, and stacks reach us as text viacrash-reports.json, the crash dialog's "Copy Details", or the opt-in feedback POST. A human reads them, so the maps have to be fetchable by a human.mainbuilds withsourcemap: 'hidden'(#17527) — the maps are produced in CI but were never published anywhere.Change
Zip the maps on the
linux-x64leg and upload to the draft release asorca-sourcemaps-<tag>.zip.out/mainbuild)Build appand beforePublish release artifacts (Linux), so it readsout/before packaging filters itbuild.sourcemapbreaks the release loudly instead of silently shipping undecodable buildsNo change to installed app size —
!out/**/*.map(added in #17527) keeps them out ofapp.asar, andhiddenmeans nosourceMappingURLis emitted, so the app never looks for them.Verification
out/mainbuild: 69 files, 35,385,172 B → 8,407,468 B.config/scripts/release-cut-sourcemap-publish.test.mjs(3 tests) covers single-leg gating, the fail-loud guard, and step ordering relative toBuild app/Publish release artifacts (Linux).release-cut-token-permissions,publish-complete-draft-releases,windows-signing-workflow-contract,release-cut-signpath-slack— 16 tests).Merge order
Depends on #17527 for
sourcemap: 'hidden'and the!out/**/*.mappackaging exclusion. Merge #17527 first, or this leg's guard will fail the next release.