Skip to content

fix(core): support multiple brace groups in workspace glob matching - #36395

Merged
FrozenPandaz merged 1 commit into
masterfrom
fix-native-glob-multi-brace
Jul 20, 2026
Merged

fix(core): support multiple brace groups in workspace glob matching#36395
FrozenPandaz merged 1 commit into
masterfrom
fix-native-glob-multi-brace

Conversation

@leosvelperez

Copy link
Copy Markdown
Member

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.


View session information ↗

@netlify

netlify Bot commented Jul 17, 2026

Copy link
Copy Markdown

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit ba683ee
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/6a5dcc4482b75d0008daa3b0
😎 Deploy Preview https://deploy-preview-36395--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 17, 2026

Copy link
Copy Markdown

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit ba683ee
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6a5dcc44c611fb0008606a3a
😎 Deploy Preview https://deploy-preview-36395--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud

nx-cloud Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit ba683ee

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 10m 46s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 4s View ↗
nx-cloud record -- pnpm nx-cloud conformance:check ✅ Succeeded 1m 2s View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 17s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-20 10:03:53 UTC

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.

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.

Nx Cloud View detailed reasoning in Nx Cloud ↗


🎓 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
leosvelperez force-pushed the fix-native-glob-multi-brace branch from 5b6bf10 to ba683ee Compare July 20, 2026 07:20
@leosvelperez
leosvelperez marked this pull request as ready for review July 20, 2026 10:19
@leosvelperez
leosvelperez requested a review from a team as a code owner July 20, 2026 10:19
@leosvelperez
leosvelperez requested a review from lourw July 20, 2026 10:19
@FrozenPandaz
FrozenPandaz merged commit 4df7a76 into master Jul 20, 2026
26 of 27 checks passed
@FrozenPandaz
FrozenPandaz deleted the fix-native-glob-multi-brace branch July 20, 2026 19:54
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants