feat(rigging): setup-node dependency cache derived from the package manager - #46
Conversation
) The generated node job now passes setup-node's cache input, derived from the configured package manager: npm, pnpm, or yarn (classic). The store is restored keyed on the lockfile instead of installing cold every run. bun gets no cache input (setup-node v7 supports only npm/pnpm/yarn), and yarn-berry gets none because setup-node resolves the yarn cache dir by running yarn --version during its own step -- before rigging's corepack enable -- so berry would be misdetected as the runner's Yarn 1.22 and a classic cache directory saved that berry never reads. Closes #45 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Review follow-up: the init skill narrates rendered-job details at this granularity (it already explains berry's corepack step), so the cache input and the deliberate bun/yarn-berry omission belong there too. Also drops a redundant function-local import in test_stacks.py. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
NODE_PACKAGE_MANAGERS was never in scope at module level; per-test local imports are this file's own pattern. Reverts that part of the previous commit, which broke the test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
submtd
left a comment
There was a problem hiding this comment.
Self-review (author; reviewPolicy is review, so a comment satisfies the gate).
Correctness. The cache values are exactly the strings setup-node v7 accepts, verified against the pinned SHA's own cache-utils.ts rather than current docs. The pnpm ordering requirement (manager installed before setup-node so pnpm store path resolves) was already satisfied and is now load-bearing; the plan.py comment was updated accordingly. The two omissions are correct, not gaps: setup-node cannot cache for bun, and berry would be misdetected as the runner's Yarn 1.22 because corepack enable runs after setup-node.
Tests. Registry-exhaustive cache_key pin (adding a sixth manager forces a decision), parametrized emit/omit plan tests, with_ insertion-order pin, an explicit python-unchanged test, and golden byte-identity for all nine node goldens — with node-bun.yml/node-yarn-berry.yml pinning the omission itself. Each test was watched failing before implementation. 344 passed; all six plugin suites green.
Scope. Diff contains exactly the feature, its tests/goldens, the changelog entry, and an init-skill paragraph documenting the bun/berry omission (added after a fresh-context subagent review flagged the doc gap).
Changelog. Unreleased entry is user-facing and committed.
One honest caveat, per this repo's own standing rule: byte-identical goldens cannot prove the rendered workflow runs. The input's semantics were verified against the pinned action's source, but the loop fully closes only when a rendered pnpm/yarn workflow runs on a real repo (one-life will do this naturally on its next re-render).
Verdict: ready to land.
What
Closes #45. The generated node job's
actions/setup-nodestep now carries thecacheinput, derived from the configured package manager, so CI runs restore the dependency store keyed on the lockfile instead of installing cold every run:npm→cache: "npm"pnpm→cache: "pnpm"(the existing pnpm-before-setup-node ordering is what makes this resolve; the comment inplan.pypredicted this feature)yarn1→cache: "yarn"bun→ no cache input: setup-node's v7 source supports only npm/pnpm/yarn.yarn-berry→ no cache input: setup-node resolves the yarn cache directory by runningyarn --versionduring its own step, but rigging'scorepack enableruns after setup-node — so a berry repo would be misdetected as the runner's Yarn 1.22 and a classic cache directory saved that berry never reads. Omitting the input beats emitting a silently useless one.No
stacks.node.cacheknob — the input is safe and strictly faster for every manager that gets it, and a knob can be added later if a reason to opt out ever appears.Verification
docs/advanced-usage.mdandsrc/cache-utils.tsat8207627), not current docs.cache_keypin (a sixth manager forces a decision), parametrized positive and omission cases in the plan,with_insertion-order pin, and an explicit test that python's setup step gained nothing.node-bun.ymlandnode-yarn-berry.ymlbyte-identity-pin the omission. Full suite: 344 passed; all six plugin suites green (1453 total).🤖 Generated with Claude Code