chore(ci): improve Nx sandbox cache declarations - #7833
Conversation
📝 WalkthroughWalkthroughNx 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. ChangesNx task graph and sandbox configuration
Playwright output orchestration
Import-protection artifact handling
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
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
|
View your CI Pipeline Execution ↗ for commit 48830e2
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
There was a problem hiding this comment.
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
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
Summary
dependentTaskOutputsnamed input and scope the benignLICENSEpackaging read totest:buildteeso CI retains live output without the task reading its own declared outputBefore
After
Impact
violations.*files. Each bundler/setup combination consumes its Nx-owned build log and writes isolated artifacts.test:buildpackagingLICENSE.Testing
pnpm exec nx-cloud get sandbox-reports --branch 7833 --since 1dCI=1 NX_DAEMON=false pnpm nx run tanstack-react-start-e2e-import-protection:test:e2e--vite-ssr --outputStyle=stream --skipRemoteCache— 87 passedCI=1 NX_DAEMON=false pnpm nx run tanstack-react-start-e2e-import-protection:test:e2e--vite-ssr--bundled-dev --outputStyle=stream --skipRemoteCache— 87 passedCI=1 NX_DAEMON=false pnpm nx run tanstack-react-start-e2e-import-protection:test:e2e--rsbuild-ssr --outputStyle=stream --skipRemoteCache— 87 passedCI=1 NX_DAEMON=false pnpm nx run tanstack-react-start-e2e-import-protection:build:vite:ssr --outputStyle=stream --skipRemoteCache --skipNxCacheCI=1 NX_DAEMON=false pnpm test:eslint --outputStyle=stream --skipRemoteCacheCI=1 NX_DAEMON=false pnpm test:types --outputStyle=stream --skipRemoteCacheCI=1 NX_DAEMON=false pnpm test:unit --outputStyle=stream --skipRemoteCachepnpm exec prettier --checkon the changed configuration and TypeScript filesgit diff --checkSummary by CodeRabbit
Tests
Chores