Repository navigation
ci: parallelize PR checks and accelerate Vite builds - #10989
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe pull-request workflow is split into reusable dependency installation, static analysis, type checking, compatibility, shell-contract, sharded test, packaging, and aggregate verification jobs. Electron Vite builds now support target-specific parallel execution, explicit main-process outputs, and manifest-backed renderer entries. A new script projects selected renderer web assets into a minified output. Plain-Node bundle checks, native runtime rebuild handling, and Electron download retries are updated with corresponding tests. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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: 3
🧹 Nitpick comments (1)
build-plugins/plain-node-entry-guard.ts (1)
133-140: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift
plain-node-entry-guard.tsandplain-node-entry-guard.jsduplicate the entire guard implementation.collectReachableChunks,assertNoElectronRequire,smokeLoadDaemonEntry, and thewriteBundle/closeBundledeferral logic are re-implemented identically in both files — a change or fix to one (e.g., patching a gap in the electron-detection regex, or the deferred-smoke sequencing) can silently be missed in the other, undermining a guard that exists specifically to prevent a repeat production outage.
build-plugins/plain-node-entry-guard.ts#L133-L140: keep this as the single source of truth for the writeBundle/closeBundle deferral logic.build-plugins/plain-node-entry-guard.js#L84-L119: replace this duplicated implementation with a thin re-export/wrapper around the.tsmodule's compiled output (or otherwise share the logic) instead of maintaining a parallel copy.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d7bb4e8f-021a-4f66-97b2-f7fe946a68ae
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (18)
.github/actions/install-node-dependencies/action.yml.github/workflows/pr.ymlbuild-plugins/plain-node-entry-guard.jsbuild-plugins/plain-node-entry-guard.tsconfig/electron-builder.config.cjsconfig/electron-vite-target.config.tsconfig/scripts/electron-builder-native-rebuild.cjsconfig/scripts/electron-builder-native-rebuild.test.mjsconfig/scripts/electron-vite-output-contract.test.tsconfig/scripts/git-binary-compatibility-workflow.test.mjsconfig/scripts/package-electron-runtime-contract.test.mjsconfig/scripts/plain-node-entry-guard.test.tsconfig/scripts/pr-workflow-parallelism.test.mjsconfig/scripts/project-renderer-web-client.mjsconfig/scripts/project-renderer-web-client.test.mjsconfig/scripts/run-electron-vite-targets-in-parallel.mjselectron.vite.config.tspackage.json
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: 4df8812f-1ccf-4131-a62e-af8d3f9ca867
📒 Files selected for processing (7)
.github/actions/install-node-dependencies/action.yml.github/workflows/pr.ymlconfig/scripts/electron-vite-output-contract.test.tsconfig/scripts/pr-workflow-parallelism.test.mjsconfig/scripts/project-renderer-web-client.mjsconfig/scripts/project-renderer-web-client.test.mjselectron.vite.config.ts
🚧 Files skipped from review as they are similar to previous changes (5)
- config/scripts/project-renderer-web-client.test.mjs
- config/scripts/electron-vite-output-contract.test.ts
- .github/workflows/pr.yml
- electron.vite.config.ts
- config/scripts/project-renderer-web-client.mjs
There was a problem hiding this comment.
🧹 Nitpick comments (1)
config/scripts/install-electron-package-binary.test.mjs (1)
96-145: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for "retries exhausted" and invalid retry-delay config.
Current tests cover success-after-one-retry and immediate-permanent-failure, but not the case where a transient error persists beyond all configured retries (exercising the
retryDelay === undefinedthrow branch), nor invalidORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MSparsing.✅ Suggested additional test
it('fails after exhausting configured retries on persistent transient errors', () => { const projectDir = mkTempProject() try { writeFakeElectronPackage(projectDir) writeFakeElectronGet(projectDir, { downloadFailures: 5, downloadErrorCode: 'ECONNRESET' }) writeFakeExtractor(projectDir, { createExecutable: true }) const result = runInstallScript(projectDir, { ORCA_ELECTRON_PACKAGE_RETRY_DELAYS_MS: '0,0' }) expect(result.status).toBe(1) expect( readFileSync(join(projectDir, 'electron-get.log'), 'utf8').trim().split('\n') ).toHaveLength(3) } finally { rmSync(projectDir, { recursive: true, force: true }) } })
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 979c819e-cd08-408f-91d8-421dc008a357
📒 Files selected for processing (2)
config/scripts/install-electron-package-binary.mjsconfig/scripts/install-electron-package-binary.test.mjs
* ci: parallelize and accelerate PR checks * fix(ci): make accelerated checks runtime-safe * fix(ci): address review findings * fix(ci): retry transient Electron downloads * test(ci): cover Electron download retry limits
Summary
This change makes pull-request CI substantially faster by splitting independent checks into parallel jobs, sharding the general Vitest suite 16 ways, building Electron targets concurrently, and reusing the renderer build for the standalone web client.
The required aggregate check remains named
verifyand waits for every lane. Faster here means less waiting and less duplicate work—not fewer safety checks.What changed
Parallel PR workflow
contents: read).fail-fast: falseso one failing shard does not hide other results.verifyjob as the aggregate gate; it fails unless every dependency succeeds.Dependency and runtime safety
node-gypworkaround only for native-runtime lanes.pnpm.supportedArchitecturesconfiguration instead of repeated OS/CPU flags.package.jsonorpnpm-lock.yaml.Faster builds without changing runtime contracts
viteto the pinned[email protected]compatibility package..jsentry paths used by Electron and plain-Node sidecars.out/web.Why the package files are safe
package.jsonchanges are limited to build-script wiring and the pinned Vite-to-Rolldown alias. Runtime dependencies were not removed or silently moved.pnpm-lock.yamlis the deterministic resolver update produced by that alias: Rollup/Vite-specific transitive packages are replaced by Rolldown's platform bindings while existing application dependency versions remain locked.Safety evidence:
pnpm install --frozen-lockfile --ignore-scriptssucceeds locally.package.jsonandpnpm-lock.yamlbyte-for-byte unchanged.supportedArchitecturesretains current, macOS, Linux, Windows, x64, and arm64 optional-package coverage.Testing
verifypassed.The final hosted PR lanes completed in parallel: static analysis 37s, typecheck 1m02s, Git compatibility 1m10s, shell contracts 51s, package 1m23s, and the slowest test shard 1m55s, followed by the 4s aggregate
verifygate.Screenshots
Not applicable. This is CI/build/runtime-safety work with no UI changes.
AI Review Report
CodeRabbit reviewed each change stack. All actionable findings were addressed: read-only workflow permissions, target-key validation, cache-step ordering assertions, removal of incorrect repeated pnpm OS/CPU flags, removal of duplicated guard implementation, and Electron retry edge-case coverage. Its review of the final head reported no new actionable comments.
Cross-platform assumptions were reviewed for macOS, Linux, Windows, SSH, folder workspaces, and Git 2.25 compatibility. This change does not alter workspace or source-control behavior; platform-specific native reuse is guarded by exact runtime platform and architecture checks.
Security Audit
Notes
This trades more parallel job usage for lower wall-clock time. Superseded-run cancellation limits wasted runner capacity. The added build scripts use concise contract tests and targeted
Whycomments instead of broad generated docstrings, consistent with repository style.ELI5
The old CI was one person doing a long checklist from top to bottom. Now several people do independent parts at the same time, and the big test pile is split into 16 smaller piles. The desktop and web builds also reuse the same prepared pieces instead of assembling everything twice.
There is still a final teacher called
verifywho waits for every person and refuses to pass the PR if any part failed. The runtime checks are like labels on puzzle pieces: Node pieces are prepared for Node, Electron pieces for Electron, and cross-platform pieces are rebuilt when the label does not match—so making the line faster does not mix incompatible parts into the app.