ci(root): stop the test step rebuilding under running suites - #668
mobeenabdullah wants to merge 1 commit into
Conversation
|
@codex please review this PR |
|
Warning Review limit reached
Next review available in: 36 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 (1)
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 |
|
Two verifications on the risks a reviewer would reasonably raise, both run rather than argued. 1. Does 2. Does It does not regress it, because #651 deliberately built two guarantees and only one of them is a turbo edge. Deleting
Worth noting the shape of it: #651's author wrote the belt-and-braces because a single turbo edge was not trusted to be sufficient, and that judgement is what makes this change safe a week later. |
@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: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74f6cd8981
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| - name: Test | ||
| run: >- | ||
| pnpm turbo test | ||
| pnpm turbo test --only |
There was a problem hiding this comment.
Preserve dependency invalidation when skipping parent tasks
When a PR changes only a workspace dependency, this can replay a stale result for an unchanged dependent package: turbo.jsonc keeps test cached, but pnpm turbo test --only --filter=@nextlyhq/plugin-page-builder --dry-run=json reports dependencies: [] and inputs only from that package, whereas the command without --only includes @nextlyhq/blocks-react#build, @nextlyhq/blocks-engine#build, and the other dependency hashes. The checked-in Turbo 2.9.18 help confirms that --only “does not execute parent tasks.” Because the workflow restores Turbo entries from prior SHAs, a blocks-react change can therefore leave plugin-page-builder's dependency-importing suites cached and unexecuted despite the fresh Build step. Force the selected tests to execute (for example with --force) or otherwise retain dependency content in their cache keys while avoiding artifact replay.
Useful? React with 👍 / 👎.
| - name: Test | ||
| run: >- | ||
| pnpm turbo test | ||
| pnpm turbo test --only |
There was a problem hiding this comment.
Move the nested build ahead of concurrent tests
When @nextlyhq/blocks-react#test is a cache miss alongside any dependent suite, this still starts a build after the concurrent Test step has begun: its vitest.global-setup.ts unconditionally runs pnpm exec turbo run build --filter=@nextlyhq/blocks-react, including the ^build chain, while an --only dry run shows the selected test tasks have no ordering dependencies. At that point builder and plugin-page-builder suites can already be collecting imports from blocks-react or blocks-engine, and both packages' tsup configurations use clean: true, so the nested build can delete and rewrite the same dist trees that those suites are resolving. This preserves the missing-chunk race the change is intended to remove; the blocks-react build needs to happen before the concurrent test phase, or its global setup must avoid rebuilding when CI has already completed that build.
Useful? React with 👍 / 👎.
|
Superseded by the PR above — |
PRs have been going red on
Lint / Typecheck / Test / Buildwith errors like:in packages the change never touched, and in a different package each run.
Cause, measured rather than argued
The
Teststep runspnpm turbo test --filter=…after theBuildstep has already built every package. BecausetestdeclaresdependsOn: ["^build"], turbo re-materialises each test's build dependencies from cache — it rewrites theirdist/directories while sibling suites are already collecting against them.Measured on a fully built tree, three filters only:
turbo test --filter=…(what CI runs today)turbo test --only --filter=…Eleven packages'
dist/rewritten under running test processes. A suite that resolves a dependency's entry mid-rewrite seesindex.mjsbut not yet the chunk it imports. On a fast machine with a warm cache the window is tiny, which is why this never reproduces locally; in CI it is wide enough to lose, and which package loses varies run to run.That accounts for every observation: no GitHub Actions cache is needed (a run with
Cache not foundfailed identically), the missing artifact is logged as built minutes earlier,mainsometimes gets lucky, and the failing package changes between runs.The fix
--onlyon the Test step: run the specified tasks, not their parents. The Build step immediately above already covers them.Safe because the Test step's filter list is a subset of
./packages/*, which the Build step builds. A package added to the test list but not built above would fail loudly at collection, not skip silently.It composes with #651 rather than undoing it:
blocks-reactgains its build edge fromvitest.global-setup.tsas well as from turbo, and that setup still runs.Scope, deliberately narrow
integration.ymlhas the same build-then-test shape and I did not change it. Those jobs are green today, I cannot run them locally without the database services, and changing something green on an analogy is how the last three attempts at this went wrong. If integration ever shows the symptom, the same one-word fix applies with its own evidence.Honesty about the path here
This is the fourth hypothesis for this failure. The first three — cancelled runs poisoning the turbo cache, concurrent workflows sharing a cache key,
tsup clean: trueracing a test — were each falsified by evidence, and one of them reachedmainas #667 before I could retract it. #667 is not harmful and its cache-save gating stands on its own, but it did not fix this.What makes this one different is that it is measured, not inferred: 11 replays versus 0, on the same tree, one flag apart.
No changeset — CI-only, per AGENTS.md.