Title: fix(ci): scope the Next.js build cache sticky disk per branch by waleedlatif1 · Pull Request #6072 · simstudioai/sim · GitHub
Open Graph Title: fix(ci): scope the Next.js build cache sticky disk per branch by waleedlatif1 · Pull Request #6072 · simstudioai/sim
X Title: fix(ci): scope the Next.js build cache sticky disk per branch by waleedlatif1 · Pull Request #6072 · simstudioai/sim
Description: Summary The Turbopack persistent build cache sticky disk was keyed on github.event_name alone, so every open PR shared one mutable volume. Per Blacksmith's docs a sticky disk mount clones the last committed snapshot and the job commits back last-write-wins — so each PR build restored a Turbopack cache produced by a different branch. Keys it per branch, reports whether the cache was actually warm, and deletes a branch's disk when its PR closes. Evidence Same staging commit, two runs minutes apart, identical runner — the only variable is which disk was mounted: run event disk compile 30500234987 push …-nextjs-cache-push 9.3 min 30500235932 pull_request …-nextjs-cache-pull_request 14.0 min Across 22 recent runs the split is clean: push builds 3.5–11 min, PR builds 13.5–17.8 min. Why this is the correctness fix, not just a perf tweak turbopackFileSystemCacheForBuild is beta, and restoring a cache built at a different commit is not a documented-supported mode. In vercel/next.js#87283 a user reports stale HTML in production from exactly that — the same commit producing different output depending on which cache was restored — and asks maintainers whether cross-build restore is supported at all. Unanswered. Others report build errors and 404s after branch switches. Sharing one mutable Turbopack build cache across ~10 concurrent PR branches with last-write-wins is precisely that configuration, which means Build App may not faithfully reflect the branch under test. Per-branch keying is also the documented pattern, not a workaround. Next.js's own CI-caching guide uses key: \${CI_COMMIT_REF_SLUG} (per-branch) in its GitLab example, and its GitHub Actions example only looks shared — GHA cache is branch-scoped by design ("cannot restore caches created for child branches or sibling branches"; PR caches are scoped to the merge ref). Blacksmith's own cache product branch-scopes by default too. This key was the only layer in the stack with no branch isolation. What this does NOT fix This will not get Build App back to 3 minutes. On the single-writer push disk — genuinely warm — compile has itself roughly doubled today: date compile (staging push) Jul 27–28 3.5–6.2 min Jul 29 morning 4.9–6.9 min Jul 29 ~14:50 PT onward 9.3–11.1 min The inflection sits between the 11:54 PT and 14:50 PT builds. That regression is real and separate; it needs a bisect and is not addressed here. Trade-offs Sticky disks have no restore-keys fallback, so the first build on a new branch is fully cold. Given cross-commit restore is dubious anyway, cold-first is the safe behavior — and the new reporting gives us the actual cold number instead of a guess. One-time cost: every currently-open PR gets one cold build on its next push. Storage: per-branch disks at ~5 GB each are bounded by ci-cache-cleanup.yml on PR close. continue-on-error: true because PRs that skipped Build App via paths-ignore have no disk to delete. Fork PRs are keyed by the fork's branch name, so two forks with the same branch name still share. Strictly better than today (all forks shared one disk), not perfect isolation. Type of Change Bug fix Improvement Testing actionlint clean on both workflows (only the pre-existing unknown-blacksmith-*-label false positive). stickydisk-delete pinned to the real v1 commit SHA with its delete-key input verified against the action's action.yml. This PR's own Build App run is the first check: it should report PRE_BUILD_CACHE=cold (new branch, new key), and a second push to this branch should report PRE_BUILD_CACHE=warm with a faster compile. That is the direct verification of the whole premise — worth confirming before merge.
Open Graph Description: Summary The Turbopack persistent build cache sticky disk was keyed on github.event_name alone, so every open PR shared one mutable volume. Per Blacksmith's docs a sticky disk mount clones the l...
X Description: Summary The Turbopack persistent build cache sticky disk was keyed on github.event_name alone, so every open PR shared one mutable volume. Per Blacksmith's docs a sticky disk mount clones t...
Opengraph URL: https://github.com/simstudioai/sim/pull/6072
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:70de5298-5e17-0fe2-04af-f30c29cf9822 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A55E:3FAE84:511CB8:706CEC:6AFB3BC9 |
| html-safe-nonce | 1e0775ad44de58637bf3a4f3db336266b00bc1a88263397d3c23864e16f107f7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTVFOjNGQUU4NDo1MTFDQjg6NzA2Q0VDOjZBRkIzQkM5IiwidmlzaXRvcl9pZCI6IjMxNDQ5MDE4NzM0MjUzOTg3MjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5c5f4301413636479cd059052fcd59378cd3aeb041e6d7d01252cdebc553d6c9 |
| hovercard-subject-tag | pull_request:4165109402 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6072/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary The Turbopack persistent build cache sticky disk was keyed on github.event_name alone, so every open PR shared one mutable volume. Per Blacksmith's docs a sticky disk mount clones the l... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2169b0dfbef67ed6b128074a5ed45bb7d5d1859783b10178b09a7765ad5f3693 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b4fc8df5ef1c6757e733a23e6b81b6725021823 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width