fix(turbo): bust cli-test build cache when fixtures change#1145
Conversation
`@sanity/cli-test` bundles its test fixtures by copying them from the repo-root `fixtures/` via `copy:fixtures` at build time. The generic `build` task only keys its cache on files inside the package, so editing a repo-root fixture left the cache key unchanged and turbo replayed a stale bundled copy — tests then ran against an outdated fixture. Key cli-test's build on `$TURBO_ROOT$/fixtures` and the workspace catalog (also read by `copy:fixtures`) so fixture edits invalidate it.
|
Claude finished @gu-stav's task in 1m 24s —— View job Claude Review
FindingsNo blocking issues. The override correctly mirrors the two repo-root paths that A couple of notes worth confirming, but not blocking:
ChangesetNot needed. This is build/CI cache configuration only — no runtime or public API change. The |
📦 Bundle Stats —
|
| Metric | Value | vs main (7d2118d) |
|---|---|---|
| Internal (raw) | 2.1 KB | - |
| Internal (gzip) | 799 B | - |
| Bundled (raw) | 10.97 MB | - |
| Bundled (gzip) | 2.06 MB | - |
| Import time | 824ms | -8ms, -1.0% |
bin:sanity
| Metric | Value | vs main (7d2118d) |
|---|---|---|
| Internal (raw) | 1023 B | - |
| Internal (gzip) | 486 B | - |
| Bundled (raw) | 9.87 MB | - |
| Bundled (gzip) | 1.77 MB | - |
| Import time | 1.93s | -40ms, -2.0% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — @sanity/cli-core
Compared against main (7d2118d4)
| Metric | Value | vs main (7d2118d) |
|---|---|---|
| Internal (raw) | 96.3 KB | - |
| Internal (gzip) | 22.7 KB | - |
| Bundled (raw) | 21.64 MB | - |
| Bundled (gzip) | 3.43 MB | - |
| Import time | 785ms | -13ms, -1.6% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — create-sanity
Compared against main (7d2118d4)
| Metric | Value | vs main (7d2118d) |
|---|---|---|
| Internal (raw) | 908 B | - |
| Internal (gzip) | 483 B | - |
| Bundled (raw) | 931 B | - |
| Bundled (gzip) | 491 B | - |
| Import time | ❌ ChildProcess denied: node | - |
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
Coverage DeltaNo covered files changed in this PR. Overall Coverage
|
@sanity/cli-testbundles its test fixtures by copying them from the repo-rootfixtures/viacopy:fixturesat build time.The generic
buildtask only keys its cache on files inside the package, so editing a repo-root fixture leaves cli-test's cache key unchanged. turbo then replays a stale bundled copy and tests run against an outdated fixture — a silent, confusing failure mode (the test reads a fixture that no longer matches what's on disk).Fix: give
@sanity/cli-test#buildan explicit input set that includes$TURBO_ROOT$/fixturesandpnpm-workspace.yaml(the catalogcopy:fixturesalso reads), so fixture edits invalidate the cache.Note
Low Risk
CI/cache configuration only; no runtime product or security behavior changes.
Overview
Adds a Turbo override for
@sanity/cli-test#buildso cache keys include repo-rootfixtures/**andpnpm-workspace.yaml, not only files inside the package.That way edits to shared fixtures (copied in at build via
copy:fixtures) invalidate the build cache instead of reusing a stale bundled copy during CI.Reviewed by Cursor Bugbot for commit d22456c. Bugbot is set up for automated code reviews on this repo. Configure here.