Skip to content

ci: skip unrelated installs and share xterm build dependencies - #23607

Merged
nwparker merged 6 commits into
mainfrom
nwparker/ci-cache-followup
Sep 28, 2026
Merged

nwparker merged 6 commits into
mainfrom
nwparker/ci-cache-followup

Conversation

@nwparker

@nwparker nwparker commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Xterm patch checks finish sooner by installing only the tools they use. Every pristine and patched bundle is still rebuilt and compared.

What Changed

Use Node directly instead of restoring and installing Orca's unrelated dependencies. Restore the pinned upstream checkout's installed tools from a shared main cache. Cache keys separate Ubuntu versions, architecture, exact Node versions, manifests and generator/action changes; cache hits recheck the pinned tool versions. A miss tries the existing npm-download fallback. That fallback is best-effort: it may expire after seven idle days, in which case the normal cold npm ci path runs. We avoid a daily download-cache restore solely to keep rarely needed fallback data alive.

A main-only producer verifies before saving. It runs on relevant changes and daily to handle Node patch releases or eviction, and skips verification on hits. PRs restore only. Temporary benchmark workflows have been removed.

Why

This avoids redundant installation without caching a passing test result. Dependency reuse alone was a modest gain on ARM64; removing Orca installation made the complete change worthwhile. Both producer and consumer use ubuntu-24.04-arm, enforced by a workflow test.

Testing

  • ARM64 fresh-runner comparisons, including changed setup/restore/verification/post steps: baseline 73, 85, 71 seconds; candidate 56, 58, 52 seconds. Medians 73 → 56 seconds (23% lower); every pair improved. Benchmark run.
  • Dependency-only ARM64 pilot: baseline 56, 58, 63 seconds versus 55, 54, 51 seconds, including restore. Run. Earlier x64 results are not used to justify this ARM64 change.
  • Seed verification took 57 seconds plus 4 seconds to save the installed-tools archive; the archive is 86.7 MB. Seed cost must be amortized across subsequent checks. The observed warm producer setup was 15 seconds including checkout and the pilot's extra baseline restore; production omits that unconditional extra restore. This is not a claim about whole-repository CI percentages.
  • All hosted benchmark checks passed the real generator's byte comparisons. 69 relevant local tests passed; actionlint and changed-code quality passed. Full CI passed on final head c55929ed491b, including all eight unit shards, typecheck, static analysis and both packaging jobs: https://github.com/stablyai/orca/actions/runs/36410345808.

Linked Issue

N/A — maintainer-requested CI optimization.

Visual Proof

N/A — CI only; no UI or application behavior changes.

Review

Exact cache keys, main-only writers, successful verification before publication, cold fallback, preserved full checks, and producer/consumer runner alignment reviewed. No SSH, folder workspace, Windows or macOS runtime changes.

Agent skill upstream boundary

  • Not applicable.

Checklist

  • Scoped change with measured benefit and preserved verification.
  • Explained mechanism, alternatives and seed cost.
  • Local tests and changed-code quality passed.
  • Full CI on final commit passed.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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: d04bed2b-bcd9-4660-a808-947d5a92286c

📥 Commits

Reviewing files that changed from the base of the PR and between 7682b70 and 5fedee6.

📒 Files selected for processing (4)
  • .github/workflows/ci-xterm-dependency-pilot.yml
  • .github/workflows/pr.yml
  • config/scripts/pr-workflow-parallelism.test.mjs
  • config/scripts/xterm-dependency-cache.test.mjs
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci-xterm-dependency-pilot.yml

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


📝 Walkthrough

Walkthrough

The changes add a composite action that restores xterm dependency caches and exposes cache status. New workflows seed the cache and compare three cache-disabled samples with three cache-enabled samples on pull requests. The existing pull-request workflow now uses the shared action. Patch regeneration checks the toolchain when installed dependencies match the install stamp.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to c5592

Cached dependencies remain tied to the pinned xterm source and runtime inputs, while patch verification still runs. No concrete merge-blocking regression is established; complete the planned measurements and normal CI checks.

Architecture Summary

Architecture risk: 🔵 Low · up to 5fede

The change affects 1 system.

Changed systems: config

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — config (service) was modified; 3 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in config/scripts/regenerate-xterm-patches.mjs: On an install-stamp cache hit, ensureDependencies now calls assertToolchain before returning; previously it returned without checking installed tool versions.
  • observed — Modified behavior in config/scripts/pr-workflow-parallelism.test.mjs: The test continues to assert that typecheck and git_compatibility install steps have no with configuration, but now asserts that xterm_patch_sync has no install step at all. Previously, it expected an install step and checked its with configuration.
  • observed — Modified behavior in config/scripts/xterm-dependency-cache.test.mjs: Adds YAML-loading setup that reads the dependency-cache action and CI workflow and locates the restore step.
  • observed — Modified behavior in config/scripts/xterm-dependency-cache.test.mjs: Adds assertions that the restore key distinguishes the listed runner, runtime, architecture, and xterm-related inputs; uses cache restore v5 without restore keys; and restores only the upstream Git metadata and node_modules paths.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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 3 files. (2 skipped: 2 … 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 summarizes the main changes: avoiding unrelated dependency installation and sharing xterm build dependencies through caching.
Description check ✅ Passed The description is complete and focused. It explains the user-facing change, mechanism, rationale, linked-issue exception, lack of visual changes, testing evidence, review considerations, and upstream…
Full details: Docstring Coverage

Explanation

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 3 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

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.

@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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 327a81de-f4ab-4e77-946f-dfae8a57db02

📥 Commits

Reviewing files that changed from the base of the PR and between 8b410b4 and 045a853.

📒 Files selected for processing (4)
  • .github/actions/prepare-xterm-dependencies/action.yml
  • .github/workflows/ci-xterm-cache.yml
  • .github/workflows/pr.yml
  • config/scripts/regenerate-xterm-patches.mjs

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

Comment thread .github/workflows/ci-xterm-cache.yml Resolved

@pullfrog pullfrog 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.

Important

The installed-dependency cache this PR adds can never be restored by the job it was written for: the key embeds runner.arch, only the seed job on ubuntu-latest (X64) saves it, and xterm_patch_sync runs on ubuntu-24.04-arm (ARM64) with no restore-keys. As written, production gets no reuse, and the benchmark measures the wrong architecture.

Reviewed changes

  • New composite action — .github/actions/prepare-xterm-dependencies/action.yml restores the pinned upstream checkout's .git and installed node_modules, keyed by OS, arch, resolved Node version, and a hash of the manifest plus the generator/action files.
  • New pilot workflow — .github/workflows/ci-xterm-cache.yml seeds that cache on main (and when its own inputs change) and runs a six-leg baseline/cache benchmark on pull requests.
  • Production consumer — xterm_patch_sync in pr.yml replaces its inline ~/.npm + .git cache step with the new action.
  • Generator guard — ensureDependencies now calls assertToolchain on the install-stamp hit path, so a reused node_modules whose pinned toolchain drifted fails loudly instead of being silently reused.

ℹ️ A production cache miss is colder than the benchmark's baseline

The benchmark's cache: false arm restores the xterm-upstream-* npm download cache before a cold install, but the production job no longer restores it. A real miss therefore runs npm ci with no registry cache at all — a path the benchmark never measures, and one that the new key makes more frequent (any generator-script or action edit now invalidates the key).

Technical details
# Production miss loses the npm download cache

## Affected sites
- `.github/workflows/pr.yml:488` — the action restores only `.git` + `node_modules`; the step it replaced also restored `~/.npm`.
- `.github/workflows/ci-xterm-cache.yml:66-73` — the benchmark's `cache: false` arm still restores `xterm-upstream-*` (`~/.npm` + `.git`), so it is not the production miss path.

## Required outcome
- Either restore the existing `xterm-upstream-*` key alongside the installed-deps cache in `xterm_patch_sync`, or state explicitly that a fully cold install on miss is the accepted trade and treat the `cache: false` arm as reference-only.

## Open questions for the human
- Is the plan to keep `xterm_patch_sync` on arm64, or move it? That decides whether the npm-cache restore is worth reinstating.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread .github/workflows/ci-xterm-cache.yml Resolved

@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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 5a7e963a-7f51-46e6-b0e5-ab00f10e50e0

📥 Commits

Reviewing files that changed from the base of the PR and between 045a853 and 7682b70.

📒 Files selected for processing (4)
  • .github/actions/prepare-xterm-dependencies/action.yml
  • .github/workflows/ci-xterm-cache.yml
  • .github/workflows/ci-xterm-dependency-pilot.yml
  • config/scripts/xterm-dependency-cache.test.mjs

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

@pullfrog pullfrog 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.

ℹ️ No critical issues — minor suggestions inline.

Reviewed changes

Since the last pullfrog review (045a853), this update:

  • Bound the production seed to verified main entries — ci-xterm-cache.yml drops its pull_request trigger and measure job, gates seed on github.ref == 'refs/heads/main', replaces install-node-dependencies with a bare actions/setup-node, and removes the inline baseline npm-cache step.
  • Moved reuse onto the production architecture — seed now runs ubuntu-24.04-arm (matching xterm_patch_sync), the pilot's measure matrix also runs ARM, and the cache key gained the /etc/os-release image so an image change invalidates it.
  • Moved the npm download fallback into the action — xterm-upstream-* (~/.npm + .git) is now restored on an installed-deps miss, so a production miss is no longer colder than the benchmark baseline.
  • Added a stand-alone ARM pilot workflow — ci-xterm-dependency-pilot.yml seeds the installed-deps cache and runs the sample × cache benchmark on ubuntu-24.04-arm.
  • Added a YAML-contract test covering the action key/paths, the seed's save ordering and guards, and the production consumer's use of the action.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment on lines +48 to +49
- name: Preserve fallback downloads
if: steps.cache.outputs.cache-hit != 'true'

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.

This save — and the action's matching restore — run only on an installed-deps miss, which is the same condition that governs the fallback's only access. In steady state the installed-deps key hits (production xterm_patch_sync and every nightly seed skip the fallback), so xterm-upstream-* sees no access for >7 days and GitHub evicts it; it is then likely absent on the first key rotation, exactly the miss it was added to warm. The pilot's unconditional actions/cache@v5 at ci-xterm-dependency-pilot.yml:24 is the keep-alive shape this seed lacks; either restore it unconditionally here too, or accept that a key rotation starts fully cold.

Technical details
# Fallback npm cache expires before the miss it warms

## Affected sites
- `.github/workflows/ci-xterm-cache.yml:48-49` — "Preserve fallback downloads" saves only when the installed-deps key misses.
- `.github/actions/prepare-xterm-dependencies/action.yml:26-27` — the fallback is restored only when the installed-deps key misses.
- `.github/workflows/ci-xterm-dependency-pilot.yml:24-30` — the pilot's unconditional `actions/cache@v5` is the keep-alive shape the seed lacks.

## Required outcome
- Either restore `xterm-upstream-*` unconditionally in the seed so its last-access stays recent, or state explicitly that the fallback is best-effort and expect a cold `npm ci` when the installed-deps key eventually rotates.

## Open questions for the human
- Is a fully cold `npm ci` on a key rotation acceptable, or should the fallback be kept warm?

readYaml('../../.github/workflows/pr.yml').jobs.xterm_patch_sync['runs-on']
)
expect(pr.some((step) => step.uses === './.github/actions/prepare-xterm-dependencies')).toBe(true)
expect(pr.some((step) => /cache(?:\/save)?@/.test(step.uses ?? ''))).toBe(false)

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.

This regex matches actions/cache@v5 and actions/cache/save@v5 but not actions/cache/restore@v5, so the guard that production uses no direct cache action would miss a restore-only substitution. Extending the alternation to save|restore closes the hole.

@nwparker nwparker changed the title ci: reuse pinned xterm build dependencies ci: skip unrelated installs and share xterm build dependencies Sep 28, 2026

@pullfrog pullfrog 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.

ℹ️ No new issues in the latest commits — approval is withheld only because the two prior minor threads are still unresolved.

Reviewed changes

Since the last pullfrog review (7682b70), this update:

  • Makes the production xterm job dependency-free — xterm_patch_sync drops install-node-dependencies for a bare actions/setup-node@v6; the generator's --check needs only node/npm/git/tar plus its local xterm-patch-text.mjs, so no Orca node_modules or pnpm is required.
  • Removes the completed benchmark pilot — ci-xterm-dependency-pilot.yml is deleted, and nothing in the workflows or tests references it.
  • Covers the new production shape in tests — pr-workflow-parallelism.test.mjs asserts xterm_patch_sync has no install step, and xterm-dependency-cache.test.mjs asserts its setup-node inputs and the absence of any direct cache action. Both files pass locally (24 tests).

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@nwparker
nwparker merged commit cf20423 into main Sep 28, 2026
35 checks passed
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