ci(root): stop a cancelled run from publishing a half-built turbo cache - #667
Conversation
|
@codex please review this PR |
|
Warning Review limit reached
Next review available in: 2 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
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. Comment |
@nextlyhq/adapter-drizzle
@nextlyhq/adapter-mysql
@nextlyhq/adapter-postgres
@nextlyhq/adapter-sqlite
@nextlyhq/admin
@nextlyhq/admin-css
@nextlyhq/blocks-engine
@nextlyhq/blocks-react
@nextlyhq/builder
create-nextly-app
nextly
@nextlyhq/plugin-form-builder
@nextlyhq/plugin-page-builder
@nextlyhq/plugin-sdk
@nextlyhq/plugin-seo
@nextlyhq/storage-s3
@nextlyhq/storage-uploadthing
@nextlyhq/storage-vercel-blob
@nextlyhq/ui
commit: |
|
@codex please review this PR |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Holding this as a draft — the premise in the body is falsified. This PR argued the red was caused by the shared turbo cache key. That is wrong, and the evidence is this PR's own CI run: No Two further theories died the same way:
What is established: The cache-budget finding stands on its own and is worth acting on regardless — |
CI is failing PRs on
Lint / Typecheck / Test / Buildwith errors like:in packages the pull request never touched.
The mechanism, with the evidence
Six jobs across four workflows cache
.turbounder one key,turbo-${{ runner.os }}-${{ github.sha }}, withrestore-keys: turbo-${{ runner.os }}-. On a pull request,ci(×2 jobs),integration(×2) andpreviewall run concurrently on the same commit — and they build different filter sets:ci./packages/*and./apps/*e2e./packages/*preview./packages/*integration,integration-sqliteOne key, five concurrent writers, first one wins.
The timestamps prove it happened. #661's turbo cache was created at 11:12:36. The
Preview releaseworkflow for that same commit ran 11:06:05→11:12:39 — three seconds later.CIwas still running (11:06:05→11:32:02) and had not reached its post step. The cache thatcilater restored was written bypreview.A job then restores a
.turboshaped by someone else's build, reportscache hit, replaying logs, and lays down adist/that does not contain what its own tests import. The failing build never ran: the log saysnextly:build → cache hit, replaying logs c587c5cd93b644a4. Every package setsclean: true, so a build that runs cannot leave a partialdist/— which is what pointed at the cache in the first place.And it cannot be cleared by hand: the key is the commit, so re-running the failed job scores an exact hit on the same foreign entry. That is the first thing anyone tries, and it is the one thing that cannot work.
The fix
Scope the key to the job —
turbo-v2-${{ runner.os }}-${{ github.job }}-${{ github.sha }}, restore-keys likewise. Each job restores its own lineage. Nothing is lost: a job's own previous runs are what its cache was ever useful for, and turbo entries are content-addressed, so a narrower cache is a slower run and never a wrong one.Split restore from save and gate the save on
success().actions/cachesaves in a post step that runs however the job ended; splitting is the supported way to make it conditional, now thatsave-alwaysis deprecated. Independent of the sharing bug, and cheap.Bump the prefix to
turbo-v2-. Keys are immutable andrestore-keysprefers the newest match, so the entries already written under the shared scheme would keep being selected. This retires them in one step and unblocks the PRs that are red right now.The Playwright browser cache in
ci.ymlis deliberately untouched — it is keyed on the lockfile hash and is a different concern.A correction to my first pass
The first version of this PR blamed
cancel-in-progresscancelling runs mid-build, and gated the save on that basis. Correlating every cache entry against its run showed caches being created mid-run, which cancellation does not explain and concurrent writers do. The save gating stayed because it is independently correct; the key scoping is the fix.Verification
path: .turbo,if: success()present, and${{ github.job }}in both key and restore-keys.actions/cache@remains for.turbo.No changeset — CI-only, per AGENTS.md.