Skip to content

[CI] perf(ci): compile release JavaScript once for all packaging hosts - #25828

Merged
nwparker merged 17 commits into
mainfrom
nwparker/C3I
Oct 6, 2026
Merged

nwparker merged 17 commits into
mainfrom
nwparker/C3I

Conversation

@nwparker

@nwparker nwparker commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Release packaging currently compiles the same JavaScript separately on every platform. Compile it once, then let each platform build its native components and package the shared output.

What Changed

A read-only job builds and archives the CLI, desktop, web and mobile web output alongside release checks. Windows, Linux x64, Linux arm64 and the separate macOS workflow restore that artifact. The manifest checks the exact source commit, version, release configuration, archive and every file before replacement. Older source commits keep their original full build.

Source text uses consistent line endings across hosts. The web projection retains already-minified Vite chunk bindings while continuing to minify vendor files. Windows archive operations use the existing system-tar selection so drive-letter paths work. Build staging is excluded from app.asar so transfer archives and manifests never ship inside the desktop app. Two current-main thinking-state test fixtures now pass the current { items } input shape, repairing CLI compilation. The session host uses its existing exported delivery type to meet its existing line cap.

Why

This removes duplicate compilation while retaining host-specific relay staging, native builds, runtime checks and signing gates. An artifact from the same release run avoids persistent-cache invalidation and cannot reuse output from another release configuration.

Linked Issue

N/A — internal CI improvement.

Visual Proof

N/A — no UI or interaction changes.

Testing

  • Manually tested locally: complete JavaScript release build, archive round trip and restored CLI, renderer, web and mobile output checks.
  • Automated tests: 90 focused release checks and all 36 packaging-configuration checks pass, covering artifact integrity/configuration, cross-platform parity, workflows, dispatch, permissions, archive selection and web projection. Typecheck and changed-code quality pass.
  • New workflows pass actionlint; existing release workflow ShellCheck/custom-runner findings remain unchanged.
  • A nonpublishing comparison runs the original and shared builds on Linux x64, Linux arm64, Windows x64 and macOS arm64. It charges artifact downloads, restoration and the entire producer job to the measured savings.

Measured CI run:

Host Original build Shared build, download and restore Saved
macOS arm64 191.2s 79.2s 111.9s
Linux arm64 34.5s 12.1s 22.4s
Linux x64 29.3s 9.0s 20.2s
Windows x64 78.9s 49.4s 29.5s

The producer, all eight platform builds and the CI comparison job pass. All four output comparisons have zero differences. The producer takes 82.0 seconds, including setup, compilation, archiving and upload. After charging that job, the four hosts save 102.1 runner-seconds net. This is aggregate execution time, not a claim about total release wall-clock time.

Review

Native packaging and execution checks stay on their original hosts. The producer uses GitHub-hosted infrastructure and read-only repository permissions. macOS downloads only from the parent release run. Missing or mismatched output fails; only older source commits use the legacy build.

Comparison checks normalize text line endings, generated asset references, manifest source paths/key order, and narrowly bounded native CSS color rounding; source maps are excluded from cross-host comparison. Production restoration always verifies exact producer bytes, with no normalization.

Agent skill upstream boundary

  • Not applicable; no skill source changes.

Notes

Measurements cover one paired sample on each host, including download and restore time. Consumer dependency setup, packaging and signing are excluded. The macOS benchmark uses GitHub-hosted ARM64; the release workflow retains its existing custom runner. Full release wall-clock savings have not been measured; producer work overlaps release gates but can delay packaging if it finishes later.

SSH relay staging and compatibility checks stay host-owned. Native dependency installation still follows the target OS and CPU policy.

All validation checks pass on the final commit: typechecking/static analysis, all five unit shards, platform comparisons, Windows/Linux packaging, mobile, native compatibility, relay, Git and mixed-version compatibility. Final verification passes. The advisory unit-selection evidence report also passes; all 47 validation checks are green. A unit runner was shut down; its retry then hit an unchanged SQLite file-byte assertion, which passed on the next CI run and five repeated focused local runs. Local tracked-source Node, CLI and renderer typechecks, release/packaging tests and changed-code quality pass. The local Node check excludes two unrelated untracked Windows files that are absent from CI. No signing or release publication was triggered.

Checklist

  • Change is focused on release compilation and measurement.
  • Explained the before/after, mechanism and approach.
  • Visual proof is N/A with a reason.
  • Self-reviewed for correctness, security and performance.
  • Cross-platform and SSH impact considered.
  • Local checks pass; platform build and parity results are recorded above. General CI limitations are recorded in Notes.

@nwparker
nwparker marked this pull request as ready for review October 6, 2026 18:48
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 54244eb7-e796-47ff-b38c-5f6e74b65591
📥 Commits

Reviewing files that changed from the base of the PR and between 6d11407 and dee2048.

📒 Files selected for processing (2)
  • src/main/native-chat/agent-session-wire/structured-agent-session-host.ts
  • src/renderer/src/components/native-chat/NativeChatToolLine.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The release pipeline now builds, packages, and validates JavaScript artifacts separately from host builds. Release workflows use the artifact when the source supports it and retain the full-build path otherwise. New scripts and workflows compare output parity and measure build timings across four host configurations. The changes also update renderer minification options, tar executable selection, packaging exclusions, and selected types, tests, and checkout rules.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to dee20

The reviewed edits do not identify a concrete release failure. The PR reports cross-host output parity and passing checks; no additional merge-blocking risk is established.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.90% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 29 functions across 21 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly states the main change: compile release JavaScript once for all packaging hosts.
Description check ✅ Passed The description covers the required sections, explains the change and rationale, records testing and measurements, and addresses visual proof and the upstream boundary. The linked-issue section states…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit 83cf7cf into main Oct 6, 2026
96 of 100 checks passed
@nwparker nwparker changed the title perf(ci): compile release JavaScript once for all packaging hosts [CI] perf(ci): compile release JavaScript once for all packaging hosts Oct 9, 2026
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.

1 participant