-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix(native): correct glob pattern expansion for ZeroOrOne groups #31857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Command | Status | Duration | Result |
---|---|---|---|
nx affected --targets=lint,test,build,e2e,e2e-c... |
❌ Failed | 1h 40m 12s | View ↗ |
nx run-many -t check-imports check-commit check... |
✅ Succeeded | 1m 38s | View ↗ |
nx-cloud record -- nx-cloud conformance:check |
✅ Succeeded | 2s | View ↗ |
nx-cloud record -- nx sync:check |
✅ Succeeded | 3s | View ↗ |
nx-cloud record -- nx format:check |
✅ Succeeded | 3s | View ↗ |
nx documentation |
✅ Succeeded | 4m 28s | View ↗ |
☁️ Nx Cloud last updated this comment at 2025-07-21 20:35:02
UTC
@claude add a unit test to confirm the behavioral changes here |
Claude finished @AgentEnder's task —— View job Todo List:
SummaryI've successfully added comprehensive unit tests for the ZeroOrOne glob pattern behavior to confirm the fix for issue #26880. Here's what was accomplished: Test Added: Created
Commits Made:
Analysis: The fix correctly separates The unit tests verify that this behavioral change is working correctly and will prevent regression in the future. |
The Rust hasher was incorrectly expanding glob patterns with optional groups like `__test?(s)__` because ZeroOrOne and ZeroOrMore patterns were combined in the same match arm but require different handling. The issue was that ZeroOrOne patterns were using `*` as a fallback when not matched, which caused patterns like `__test?(s)__` to incorrectly expand to `*__` instead of `__test__` when the optional `s` was not matched. This fix separates the ZeroOrOne and ZeroOrMore cases, ensuring that ZeroOrOne patterns preserve the existing pattern when the optional group is not matched. Fixes #26880 Co-authored-by: Craigory Coppola <[email protected]> test(native): add unit tests for ZeroOrOne glob pattern behavior Add comprehensive unit tests for ZeroOrOne pattern expansion to verify the fix for issue #26880 where patterns like `__test?(s)__` were incorrectly expanding to `*__` instead of `__test__`. The tests cover: - Simple ZeroOrOne pattern: `__test?(s)__` - Pattern with prefix: `prefix?(suffix)` - Pattern in middle: `start?(middle)end` - Multiple ZeroOrOne patterns: `?(a)test?(b)` Co-authored-by: Craigory Coppola <[email protected]> style(native): format Rust code with rustfmt Apply rustfmt formatting to the glob_transform.rs file to ensure consistent code style after adding the new unit tests. Co-authored-by: Craigory Coppola <[email protected]>
ab621cf
to
185ba35
Compare
The Rust hasher was incorrectly expanding glob patterns with optional groups like
__test?(s)__
because ZeroOrOne and ZeroOrMore patterns were combined in the same match arm but require different handling.The issue was that ZeroOrOne patterns were using
*
as a fallback when not matched, which caused patterns like__test?(s)__
to incorrectly expand to*__
instead of__test__
when the optionals
was not matched.This fix separates the ZeroOrOne and ZeroOrMore cases, ensuring that ZeroOrOne patterns preserve the existing pattern when the optional group is not matched.
Fixes #26880
Generated with Claude Code