fix(setup-node): recognize exact cache hits on Forgejo #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ci/pnpm-cache-exact-hit"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Forgejo returned lowercase keys after restoring all six pnpm archives in create-gmacko-app's main run 918. The pinned setup-node post action checked the complete key with a case-sensitive comparison. Each job then uploaded its already-restored store. The native logs record 4,096,757,674 bytes across those six uploads. For example, the Build task restored
node-cache-linux-x64-pnpm-0f3b7f26…and savednode-cache-Linux-x64-pnpm-0f3b7f26…. The entire SHA-256 portion matched.The post action now folds case before comparing the two complete keys. It skips upload on an exact match. A miss, a prefix match or a different lockfile hash still saves using the original key. The restore action, dist/setup, dependency versions and setup-node inputs are untouched. The provenance entry records the patch against the original upstream snapshot.
A loopback artifact cache exercised the actual bundled entry point. The original lowercase-hit replay reserved, uploaded 8,391,499 bytes and committed. The candidate made zero cache requests. The exact-case control also made zero requests. The miss, different-hash and prefix controls all reserved, uploaded the complete fixture and committed. The focused Jest suite passed 13/13. A fresh build using the locked ncc 0.38.3 and TypeScript 5.4.2 produced the exact checked-in post bundle after normalizing upstream dependency line endings to the repository's LF convention.
The create-gmacko-app consumer experiment pins this commit and retains its independent frozen installs and job timeouts. The observed upload volume is a workload measurement. Hosted timing requires a separate consumer run.
Incomplete setup recovery
Setup records cache paths before hashing the lockfile. When setup is interrupted in that interval and a post step is allowed to run, both saved keys are empty. At
4733cb0f07aethe post action preserves the upstream early return in that state. The first patch attempted to upload the fixture under the empty key. The original and final bundles made zero requests. All six bundled scenarios and all 215 Jest tests passed. Warm normalized/exact hits made zero requests, while cold, different-hash and prefix cases reserved, uploaded and committed the data.Hosted consumer observations
The first consumer deployed the exact-key change to its default branch. All six setup-node post steps in the prior main CI run restored full caches and wrote 4,096,757,674 archive bytes in total. All six post steps in the first merged main run logged an exact-key skip and wrote zero archive bytes. In both runs each of the six independent frozen installs reused all 1,635 packages and the checks passed.
The runner log timestamps bracketing the setup-node post step measured 179.243 summed job-seconds on the first run and 1.273 seconds on the merged run. The per-job median was 25.139 and 0.207 seconds respectively. Extraction to completed restore totaled 218.244 seconds and 480.007 seconds. End-to-end CI took 461 seconds and 918 seconds. The observed savings apply to the cache post step.