fix(ci): save the Next.js build cache every run instead of freezing it at the lockfile key#5859
Conversation
…t at the lockfile key
The cache key was only runner.os + bun.lock hash, and GitHub caches are
immutable per key: the first run after a lockfile change saved the cache
once, then every later run hit the primary key and skipped the save
('Cache hit occurred on the primary key ... not saving cache'), so builds
compiled against a cache stale since the last lockfile bump. Suffix the
key with the commit SHA so each run saves its refreshed cache, and
restore via prefix match to the most recent entry.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview The cache primary key now includes Reviewed by Cursor Bugbot for commit a860339. Configure here. |
Greptile SummaryThis PR refreshes the Next.js build cache on every workflow attempt. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "fix(ci): make the Next.js cache key uniq..." | Re-trigger Greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a860339. Configure here.
Summary
Build Appjob's Next.js cache key wasos + hashFiles(bun.lock)with no unique suffix — GitHub caches are immutable per key, so the cache was saved once per lockfile change and then frozen: every subsequent run loggedCache hit occurred on the primary key ... not saving cacheand compiled against an ever-staler cachegithub.shaso every run saves its refreshed.next/cache, and restore via prefix match (os-nextjs-<lockfile>-→os-nextjs-) so each run starts from the most recently saved cacheType of Change
Testing
Verified the frozen-cache behavior in the live run log (primary-key hit → save skipped). The fix's effect shows up in this PR's own
Build Appcheck and the following runs as the cache warms per-commit.Checklist