Skip to content

ci: narrow churny cache keys and move PR-local cache saves to main - #34600

Merged
OrcaWin merged 4 commits into
mainfrom
ci/cache-key-narrowing
Oct 28, 2026
Merged

OrcaWin merged 4 commits into
mainfrom
ci/cache-key-narrowing

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​161 $\color{#cf222e}{\Huge{\mathbf{−}}}$​43 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​118
Prod 23 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​376 $\color{#cf222e}{\Huge{\mathbf{−}}}$​59 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​317

The Actions cache is capped at 10 GB. This PR narrows keys that changed far more often than their outputs did, and stops PR-scoped saves of entries that main now produces.

Key changes

Cache Old key inputs New key inputs
native-modules-* the whole pnpm-lock.yaml and pnpm-workspace.yaml, plus the scripts, patches and addon sources the scripts, patches and addon sources, plus native-dependency-lock-digest.mjs, which covers the locked closures of node-pty, @vscode/windows-process-tree, @electron/rebuild and node-gyp, the workspace addons' deps (node-addon-api), the Electron version, and workspace layout and build-approval settings. OS, image or libc scope, arch, runtime, Node and pnpm stay in the key.
orcad-windows-prebuild-v2-* package.json minus version, the lockfile, the workspace file and ImageVersion the locked node-pty and node-gyp closures, the build:orcad-prebuilds and build:packages scripts, the existing build-script and patch list, and ImageOS
orcad-windows-cli-launcher-v2-*, windows-agent-hook-v2-*, windows-cli-launcher-v2-* the crate plus all of package.json the crate, the build scripts, windows-pe-imports.mjs and the icon, plus rustc version and the package.json version. restore-keys is the prefix up to and including rustc.
electron-builder-{win,linux-*}-* hashFiles('pnpm-lock.yaml'), about 613 MB per lockfile change Electron and electron-builder versions from package.json

Why none of these can serve a stale binary:

  • Native modules. Every locked package that is compiled into an addon, or that compiles one, is in the digest by its pnpm snapshot id, which includes the version and patch_hash. A selected package missing from the lockfile makes the digest step throw instead of producing a key. Restored addons are still probed by ensure-native-runtime. Of the 62 lockfile/workspace commits in 30 days, 60 produced distinct lockfile contents but only 14 distinct digests.
  • Rust executables. windows-rust-executable-build.mjs reuses an exe only when its sha256 fingerprint matches: sources, Cargo.lock, .cargo/config.toml, build scripts, icon, app version and target triple. The fingerprint omits rustc, so rustc is in the restore prefix.
  • orcad prebuild. --validate still checks the module version, N-API, Node headers, the payload hashes, arch and the job-ownership patch before a restored slot is used.
  • electron-builder. Its caches are version-addressed directories, so an older restore only re-downloads.

Saves moved to main

  • bun-*: no-cache: true on every setup-bun.
  • electron-package-*: PRs restore only on every OS. The macOS ARM64 archive is warmed by ci: warm GitHub-hosted runner caches and drop the serve-switch installer cache #34576.
  • Windows native-modules: PRs restore only. warm-windows-electron (windows-2022) is new, and package_windows no longer saves the Node ABI.
  • The warmup now also seeds the x64 orcad launcher, the agent hook and the orcad Windows prebuild for x64 and ARM64. The prebuild is validated before it is saved.

The unit-module seal is not changed here. #34512 owns it.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1c5557b7-a0aa-424d-a69c-5a256f457d3d
Commits

Reviewing files that changed from the base of the PR and between eae9564 and d65ee7f.

Files selected for processing: 1
  • .github/workflows/pr.yml

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

The pull request revises native dependency and Windows Rust cache identities. It adds Windows cache warmup jobs and expands workflow triggers for cache-related changes. It changes Electron archive and Electron Builder cache conditions and keys. It disables Bun caching in several workflows and updates tests for the revised cache behavior.

Priority: Low

Merge Risk: Minimal · up to d65ee

No concrete current-head CI failure or incorrect cache reuse behavior was established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description explains the cache changes in detail, but it omits most required template sections, including an actual linked issue, ELI5, What Changed, Why, Visual Proof, Testing, Review, Agent skil… Add the required template headings and complete each section. Include a valid issue link under Linked Issue, state N/A with a reason under Visual Proof, document testing and supported platforms, complete the AI Disclosure when applicable, a…
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the two primary changes: narrower cache keys and moving pull-request cache saves to main.
Docstring Coverage Passed Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
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.
Full details: Description check

Explanation

The description explains the cache changes in detail, but it omits most required template sections, including an actual linked issue, ELI5, What Changed, Why, Visual Proof, Testing, Review, Agent skill upstream boundary, Notes, and Checklist content.

Resolution

Add the required template headings and complete each section. Include a valid issue link under Linked Issue, state N/A with a reason under Visual Proof, document testing and supported platforms, complete the AI Disclosure when applicable, address Review and cross-platform considerations, complete the Agent skill upstream boundary section, and check or explain the required checklist items.

  • Autofix · 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.

@OrcaWin
OrcaWin force-pushed the ci/cache-key-narrowing branch from 5dc80d1 to 6862afb Compare October 27, 2026 23:16
@OrcaWin
OrcaWin force-pushed the ci/cache-key-narrowing branch 2 times, most recently from b0efaf0 to eae9564 Compare October 28, 2026 00:25
OrcaWin added a commit that referenced this pull request Oct 28, 2026
Its three parallel real-Git lanes, two of them through Docker, push
git-binary-compatibility.test.ts past the 30s test timeout on the 4-vCPU
hosted runner (64s file time vs 14s), failing PR #34600 twice after #34566.

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
@OrcaWin
OrcaWin force-pushed the ci/cache-key-narrowing branch from eae9564 to d65ee7f Compare October 28, 2026 00:35

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Hash dependency edges in the native cache digest. · native-dependency-lock-digest.mjs:78-83

config/scripts/native-dependency-lock-digest.mjs:78-83
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Hash dependency edges in the native cache digest.

node-pty uses node-addon-api during its native build. If its lockfile edge changes from node-addon-api@7.1.1 to node-addon-api@7.1.0 while both snapshots remain selected, nativeDependencyClosure() returns the same snapshot set. The cache key remains unchanged.

The cache restores node-pty/build, while runtime validation checks loadability and patched behavior. It does not check which node-addon-api headers produced the binary. The cache can therefore reuse a build made with the old headers after the lockfile selects the new headers.

Include parent-to-child dependency edges in the digest input while retaining the snapshot closure for workspace-setting filtering.


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d269612a-ed75-45b3-aad4-23c75b3ca350
Commits

Reviewing files that changed from the base of the PR and between b0efaf0 and eae9564.

Files selected for processing: 6
  • .github/actions/prepare-windows-agent-hook/action.yml
  • .github/actions/prepare-windows-cli-launcher/action.yml
  • .github/workflows/ci-cache-warmup-platform-jobs.yml
  • .github/workflows/ci-cache-warmup-platforms.yml
  • .github/workflows/pr.yml
  • config/scripts/windows-rust-build-scope.mjs

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

@OrcaWin
OrcaWin merged commit 2cd3e6d into main Oct 28, 2026
100 checks passed
Jinwoo-H added a commit that referenced this pull request Oct 28, 2026
Also adds config/scripts/native-dependency-lock-digest.mjs and windows-rust-build-scope.mjs, which main's synced actions call (#34600).
Jinwoo-H added a commit that referenced this pull request Oct 28, 2026
Also adds config/scripts/native-dependency-lock-digest.mjs and windows-rust-build-scope.mjs, which main's synced actions call (#34600).
audichuang added a commit to audichuang/orca that referenced this pull request Oct 28, 2026
…tablyai#34600)

* ci: narrow native, launcher and packaging cache keys and stop PR-local saves

* ci: hash Rust crate sources, not build outputs, in launcher and hook keys

* ci: fail closed on unlocked native packages and cover transitive key inputs

* ci: resolve the Windows Rust cache scope with a script, not a nested local action

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>

(cherry picked from commit 2cd3e6d)
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