fix(core): support multiple brace groups in workspace glob matching - #36395
Merged
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 ba683ee
☁️ Nx Cloud last updated this comment at |
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
A glob that both starts with `{` and ends with `}` was treated as a single
brace group and split on every comma, so a pattern spanning several groups
(`{src,tests}/**/*.{test,spec}.{js,ts}`) was torn into fragments like
`spec}.{js` and rejected with "unopened alternate group". globset expands
these patterns natively.
Split only when the opening brace closes at the final character, and split
just the outer-level commas so a nested group stays intact; hand any
multi-group pattern to globset whole.
leosvelperez
force-pushed
the
fix-native-glob-multi-brace
branch
from
July 20, 2026 07:20
5b6bf10 to
ba683ee
Compare
leosvelperez
marked this pull request as ready for review
July 20, 2026 10:19
FrozenPandaz
approved these changes
Jul 20, 2026
FrozenPandaz
pushed a commit
that referenced
this pull request
Jul 29, 2026
…36395) ## Current Behavior A glob passed to the native workspace file matcher that both starts with `{` and ends with `}` was treated as a single brace group and split on every comma. A pattern spanning several groups, such as `{src,tests}/**/*.{test,spec}.{js,ts}`, was torn into fragments like `spec}.{js` and rejected with `error parsing glob 'spec}.{js': unopened alternate group`, which crashes project graph creation. ## Expected Behavior Such globs match correctly. Only a glob whose opening brace closes at the final character is split, and only on its outer-level commas so a nested group stays intact. Any multi-group pattern is handed to globset, which expands it natively. ## Related Issue(s) Prerequisite for #36339. <!-- polygraph-session-start --> --- [View session information ↗](https://app.trypolygraph.com/orgs/6a061dcb561c062131116eca/sessions/gh-36315-854f2c8f) <!-- polygraph-session-end --> (cherry picked from commit 4df7a76)
4 tasks
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.
Current Behavior
A glob passed to the native workspace file matcher that both starts with
{and ends with}was treated as a single brace group and split on every comma. A pattern spanning several groups, such as{src,tests}/**/*.{test,spec}.{js,ts}, was torn into fragments likespec}.{jsand rejected witherror parsing glob 'spec}.{js': unopened alternate group, which crashes project graph creation.Expected Behavior
Such globs match correctly. Only a glob whose opening brace closes at the final character is split, and only on its outer-level commas so a nested group stays intact. Any multi-group pattern is handed to globset, which expands it natively.
Related Issue(s)
Prerequisite for #36339.
View session information ↗