fix(repo): resolve graph-client build-client sandbox violations#35522
Merged
FrozenPandaz merged 2 commits intomasterfrom May 5, 2026
Merged
fix(repo): resolve graph-client build-client sandbox violations#35522FrozenPandaz merged 2 commits intomasterfrom
FrozenPandaz merged 2 commits intomasterfrom
Conversation
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
View your CI Pipeline Execution ↗ for commit 5d2e9f0
☁️ Nx Cloud last updated this comment at |
da91333 to
1816c33
Compare
1816c33 to
39bd300
Compare
…elf-Healing CI Rerun]
Contributor
There was a problem hiding this comment.
Nx Cloud has identified a flaky task in your failed CI:
🔂 Since the failure was identified as flaky, we triggered a CI rerun by adding an empty commit to this branch.
🎓 Learn more about Self-Healing CI on nx.dev
AgentEnder
approved these changes
May 5, 2026
FrozenPandaz
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves Nx Atomizer sandbox violations on
graph-client:build-client:release. The original report flagged ~1116 unexpected reads — the entirepackages/nxsource tree (965 files),packages/devkitsource (80 files),graph/client-e2eCypress files, and variouseslint.config.mjs/tsconfig.spec.json/*.stories.tsxsiblings acrossgraph/*projects.Root cause
The bare
graph/directory was registered as a webpack context dependency for the styles.css module, causingFileSystemInfo._readContextHashto recursively walk and hash every file underneath it for snapshot validation.The trigger was a single line in
graph/client/tailwind.config.js:The
ui-*segment is a wildcard at a directory level. To resolve it, Tailwind has toreaddirthe parent (graph/) to enumerate which subdirs match. Tailwind reports that parent to PostCSS as adir-dependency, whichpostcss-loadertranslates into a webpack context dependency. From there, webpack's snapshot walker:graph/— including unrelated siblings likegraph/client-e2eandgraph/migrate's test/eslint configs.graph/ui-project-details/node_modules/@nx/devkit— a pnpm workspace symlink installed because that lib declares"@nx/devkit": "workspace:*"as a dev dep (purely forimport typereferences)._resolveContextTimestampfollows the symlink target intopackages/devkit/, then throughpackages/devkit/node_modules/nx → packages/nx/, hashing every file along the way (including.rs,.snap,.fixturesource files that aren't part of any bundle).Fix
Enumerate the ui-* dirs explicitly in
graph/client/tailwind.config.js:With no wildcard at a directory segment, Tailwind reports each individual
src/dir as the context dep instead of the baregraph/. Eachsrc/subtree contains only source files (nonode_modules), so the symlink chain intopackages/{nx,devkit}is unreachable, and unrelated siblings likegraph/client-e2eare no longer touched.A comment in the config explains the trap so future maintainers know to add new
ui-*projects here.Empirical results
Local trace of file reads from the webpack-cli subprocess (
NODE_OPTIONS=--require trace-fs.jsinstrumentingfs.read*):packages/nxpackages/devkitgraph/client-e2eBundle output is byte-identical (2,930,784 bytes for
dist/apps/graph/main.js).The remaining 482 reads are all inside dirs Tailwind legitimately scans (
graph/client/src, the explicitui-*/srclist,graph/shared/src, plus actual project-graph deps likegraph/migrate). The*.stories.*and*.{spec,test}.*files within those dirs are still hit by the snapshot walker but are already handled by the existinggraph-client:build-cliententries in.nx/workflows/sandboxing-config.yaml.Other changes
.nx/workflows/sandboxing-config.yaml— removed an outdated/incorrect comment block above thegraph-cliententry. The two existing exclude patterns (**/*.stories.*,**/*.{spec,test}.*) cover the residual noise inside theui-*/srcdirs and remain unchanged.nx.json— bumpedbustto invalidate caches against the previous attempt.Caveats
graph/ui-*projects require a manual entry in this list — the config comment calls this out. Worth a follow-up if moreui-*packages are added regularly; an alternative is to read the dir list from the workspace package map at config-eval time.workspace:*type-only dep planting a pnpm symlink that webpack's snapshot walker follows) still exists for any future build that registers an over-broad context dep. The Tailwind change closes the only currently-known entry point.Verification
pnpm nx run graph-client:build-client:release --skip-nx-cache→webpack compiled successfullypackages/nx,packages/devkit, andgraph/client-e2eare no longer walkedTest plan
graph-client:build-client:releasein CI with sandbox monitoring; confirm the Atomizer report shows the unexpected-reads count drop to roughly the count of*.stories.*/*.{spec,test}.*siblings inside the ui-* src dirs (already covered by existing sandbox excludes).nx serve graph-client) still picks up Tailwind class changes in eachui-*project. The watcher now monitors each enumerated dir individually instead of via the parent glob.ui-*libs (no class regressions due to a missed enumeration).View session information ↗