fix(projection): classify '*' path entries as Patterns, not Values#57
fix(projection): classify '*' path entries as Patterns, not Values#57entlein wants to merge 1 commit into
Conversation
|
Warning Review limit reached
Next review available in: 46 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe projection helper now treats wildcard markers as dynamic segments, routing wildcard paths to ChangesWildcard classification
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@pkg/objectcache/containerprofilecache/projection_wildcard_classification_test.go`:
- Around line 15-28: Extend TestProjectField_StarPathRoutesToPatterns with an
explicit projection where spec.All is false and no exact, prefix, suffix, or
contains rule matches the wildcard path. Assert the wildcard entry remains in
Opens.Patterns rather than being dropped, while preserving the existing
literal-path assertions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 7e6a57a0-4a65-412e-bc2b-5d09b5c4265b
📒 Files selected for processing (2)
pkg/objectcache/containerprofilecache/projection_apply.gopkg/objectcache/containerprofilecache/projection_wildcard_classification_test.go
118857e to
db58291
Compare
containsDynamicSegment recognised only the one-segment DynamicIdentifier
('⋯'), so a path-surface opens entry bearing the zero-or-more
WildcardIdentifier ('*') — e.g. '/etc/ssl/*' — was routed to Values as if it
were a literal. was_path_opened tolerates this (Values and Patterns are both
matched via CompareDynamic), but it is wrong for any consumer that treats
Values as exact membership, and it drops '*'-only entries a rule needs when
spec.All is false and no prefix/suffix matcher retains them. Recognise both
wildcard markers. Regression test pins '/etc/ssl/*' -> Patterns.
Pre-existing in upstream (identical containsDynamicSegment).
Signed-off-by: Entlein <eineintlein@gmail.com>
Signed-off-by: entlein <einentlein@gmail.com>
db58291 to
c9a11a8
Compare
containsDynamicSegment recognised only the DynamicIdentifier (⋯), so path opens bearing the WildcardIdentifier () — e.g. /etc/ssl/ — were routed to Values (literals) instead of Patterns. Surfaced by Test_33_AnalyzeOpensWildcardAnchoring: /etc/ssl/* wrongly matched the bare /etc/ssl, suppressing R0002 (4 subtests red, run 30016411165). Fix: recognise both markers. Tests: unit TestProjectField_StarPathRoutesToPatterns (verified fails pre-fix, passes post-fix) + the Test_33 component test. Pre-existing in upstream (identical containsDynamicSegment) — to be sent upstream next.