Skip to content

chore(ci): improve Nx sandbox cache declarations - #7833

Open
beaussan wants to merge 16 commits into
mainfrom
codex/ci-timing-baseline
Open

chore(ci): improve Nx sandbox cache declarations#7833
beaussan wants to merge 16 commits into
mainfrom
codex/ci-timing-baseline

Conversation

@beaussan

@beaussan beaussan commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • refresh the CI timing baseline and increase large-changeset distribution from 14 to 16 runners
  • declare the workspace inputs, dependency outputs, and generated artifacts that cached build, lint, unit, type, and E2E tasks legitimately access
  • centralize dependency outputs in the dependentTaskOutputs named input and scope the benign LICENSE packaging read to test:build
  • keep import-protection builds under Nx orchestration while handing their captured logs to Playwright, with mode-specific violation artifacts for parallel Vite, bundled-dev, and Rsbuild runs
  • stream captured import-protection build logs through tee so CI retains live output without the task reading its own declared output

Before

file-fe3abeaf8c7798d280d201d2917d973a

After

image

Impact

  • CI performance: Produces a new timing baseline with two additional large-changeset runners and more accurate cache keys.
  • Cache correctness: Downstream tasks hash dependency build outputs, tasks declare the files and generated directories they actually access, and captured build logs are no longer read back as undeclared inputs.
  • E2E reliability: Import-protection mode tests no longer rebuild inside Playwright or overwrite shared violations.* files. Each bundler/setup combination consumes its Nx-owned build log and writes isolated artifacts.
  • Risk: Some tasks may see additional cache misses because their hashes now include legitimate inputs and dependency outputs. The only read exclusion is limited to test:build packaging LICENSE.
  • User-facing changes: None.

Testing

  • downloaded and validated PR sandbox reports with pnpm exec nx-cloud get sandbox-reports --branch 7833 --since 1d
  • validated focused sandbox reports for representative build, unit, type, Netlify, Cloudflare, and E2E tasks
  • CI=1 NX_DAEMON=false pnpm nx run tanstack-react-start-e2e-import-protection:test:e2e--vite-ssr --outputStyle=stream --skipRemoteCache — 87 passed
  • CI=1 NX_DAEMON=false pnpm nx run tanstack-react-start-e2e-import-protection:test:e2e--vite-ssr--bundled-dev --outputStyle=stream --skipRemoteCache — 87 passed
  • CI=1 NX_DAEMON=false pnpm nx run tanstack-react-start-e2e-import-protection:test:e2e--rsbuild-ssr --outputStyle=stream --skipRemoteCache — 87 passed
  • CI=1 NX_DAEMON=false pnpm nx run tanstack-react-start-e2e-import-protection:build:vite:ssr --outputStyle=stream --skipRemoteCache --skipNxCache
  • CI=1 NX_DAEMON=false pnpm test:eslint --outputStyle=stream --skipRemoteCache
  • CI=1 NX_DAEMON=false pnpm test:types --outputStyle=stream --skipRemoteCache
  • CI=1 NX_DAEMON=false pnpm test:unit --outputStyle=stream --skipRemoteCache
  • verified Vite, bundled-dev, and Rsbuild violation artifacts coexist under distinct mode-qualified filenames
  • pnpm exec prettier --check on the changed configuration and TypeScript files
  • git diff --check

Summary by CodeRabbit

  • Tests

    • Improved end-to-end import-protection testing across build, development, cold-start, and warm-start modes.
    • Added clearer, mode-specific violation reports and configurable build-log locations.
    • Improved cleanup and isolation of test artifacts.
  • Chores

    • Increased runner capacity for large changesets.
    • Enhanced task tracking, caching, sandboxing, build outputs, and test result handling for more reliable automation.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Nx task caching and sandboxing now account for dependent outputs and expanded build artifacts. Playwright runs capture mode-specific logs and outputs, while import-protection tests centralize violation artifact names and configurable build-log paths.

Changes

Nx task graph and sandbox configuration

Layer / File(s) Summary
Task graph and sandbox configuration
.nx/workflows/*, nx.json
Nx inputs, dependent outputs, sandbox rules, build inputs, E2E outputs, and runner capacity are updated.

Playwright output orchestration

Layer / File(s) Summary
Playwright output orchestration
scripts/nx/playwright-plugin.ts
Playwright build and test commands capture optional logs and declare mode-specific build, port, test-result, and violation outputs.

Import-protection artifact handling

Layer / File(s) Summary
Import-protection artifact naming and setup
e2e/react-start/import-protection/*
Violation filenames are generated centrally, build logs are configurable, and startup, setup, and assertions use the generated artifact paths.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant NxTask as Nx task
  participant PlaywrightPlugin
  participant Playwright
  participant ArtifactFS as Artifact files
  NxTask->>PlaywrightPlugin: Start mode-specific build or test command
  PlaywrightPlugin->>Playwright: Run command with optional log capture
  Playwright->>ArtifactFS: Write test results and violation reports
  PlaywrightPlugin->>NxTask: Declare build, port, test-result, log, and violation outputs
Loading

Possibly related PRs

  • TanStack/router#7685: Both changes involve the React Start import-protection E2E coverage and Rsbuild behavior.

Suggested reviewers: alemtuzlak, schiller-manuel

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the PR's primary changes to Nx sandbox and cache declarations for CI.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/ci-timing-baseline

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 48830e2

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 11m 17s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 2m 11s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-30 22:48:26 UTC

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@pkg-pr-new

pkg-pr-new Bot commented Jul 16, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@7833

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@7833

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@7833

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@7833

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@7833

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@7833

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@7833

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@7833

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@7833

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@7833

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@7833

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@7833

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@7833

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@7833

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@7833

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@7833

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@7833

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@7833

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@7833

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@7833

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@7833

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@7833

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@7833

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@7833

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@7833

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@7833

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@7833

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@7833

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@7833

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@7833

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@7833

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@7833

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@7833

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@7833

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@7833

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@7833

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@7833

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@7833

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@7833

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@7833

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@7833

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@7833

commit: 48830e2

@beaussan beaussan changed the title chore(ci): establish CI timing baseline chore(ci): improve Nx sandbox cache declarations Jul 16, 2026
nx-cloud[bot]

This comment was marked as outdated.

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud is proposing a fix for your failed CI:

We add "executor": "nx:noop" to the test:e2e entry in the package's nx.targets to fix the failing task. Without this, Nx's project-level configuration (which takes precedence over plugin-inferred targets) fell back to the npm script executor, causing Playwright to start a webServer via pnpm start without a pre-built dist/ directory. This change makes the base test:e2e task behave as the playwright plugin intends — a noop aggregation over the mode-specific targets that each handle their own build and test steps.

Tip

We verified this fix by re-running tanstack-react-start-e2e-import-protection:test:e2e.

diff --git a/e2e/react-start/import-protection/package.json b/e2e/react-start/import-protection/package.json
index 63f0bb32..e7b4e3f9 100644
--- a/e2e/react-start/import-protection/package.json
+++ b/e2e/react-start/import-protection/package.json
@@ -40,7 +40,8 @@
   "nx": {
     "targets": {
       "test:e2e": {
-        "parallelism": false
+        "parallelism": false,
+        "executor": "nx:noop"
       },
       "test:e2e--vite-ssr": {
         "parallelism": false

Apply fix via Nx Cloud  Reject fix via Nx Cloud


Or Apply changes locally with:

npx nx-cloud apply-locally ZNIM-hGKj

Apply fix locally with your editor ↗   View interactive diff ↗



🎓 Learn more about Self-Healing CI on nx.dev

@beaussan
beaussan marked this pull request as ready for review July 30, 2026 22:51
@beaussan
beaussan requested a review from a team as a code owner July 30, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant