Fix UUID pattern anchoring#1116
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe ChangesUuidPattern Regex Fix and Tests
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
Fix
UuidPatternso all supported UUID formats are validated as complete strings.Details
The previous pattern anchored only the first and last alternatives because regex alternation has lower precedence than the anchors. That allowed partial strings to validate when they started with a 32-character UUID, contained an old-format UUID substring, or ended with a group UUID.
This wraps the alternatives in a non-capturing group under one start/end anchor pair. The existing lowercase-only UUID formats remain unchanged.
Validation
/Users/hoangvu/go/bin/bazelisk test //src/lib/utils/tests:test_common/Users/hoangvu/go/bin/bazelisk test //src/lib/utils:common-pylint //src/lib/utils/tests:test_common-pylintSummary by CodeRabbit
Bug Fixes
Tests