Skip to content

fix(projection): classify '*' path entries as Patterns, not Values#57

Open
entlein wants to merge 1 commit into
mainfrom
fix/projection-star-classification
Open

fix(projection): classify '*' path entries as Patterns, not Values#57
entlein wants to merge 1 commit into
mainfrom
fix/projection-star-classification

Conversation

@entlein

@entlein entlein commented Jul 23, 2026

Copy link
Copy Markdown

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.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@entlein, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: daf526f0-0f3c-46d4-b1fe-975e4a188bec

📥 Commits

Reviewing files that changed from the base of the PR and between db58291 and c9a11a8.

📒 Files selected for processing (2)
  • pkg/objectcache/containerprofilecache/projection_apply.go
  • pkg/objectcache/containerprofilecache/projection_wildcard_classification_test.go
📝 Walkthrough

Walkthrough

The projection helper now treats wildcard markers as dynamic segments, routing wildcard paths to Patterns. A regression test verifies wildcard classification and preserves literal path handling.

Changes

Wildcard classification

Layer / File(s) Summary
Projection classification and regression coverage
pkg/objectcache/containerprofilecache/projection_apply.go, pkg/objectcache/containerprofilecache/projection_wildcard_classification_test.go
containsDynamicSegment recognizes both dynamic and wildcard markers. Tests verify /etc/ssl/* is placed in Patterns, while /etc/ld.so.cache remains in Values.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately states the main change: wildcard path entries are now classified as Patterns instead of Values.
Description check ✅ Passed The description is directly related to the patch and explains the bug, fix, and validation tests.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/projection-star-classification

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6a86345 and 118857e.

📒 Files selected for processing (2)
  • pkg/objectcache/containerprofilecache/projection_apply.go
  • pkg/objectcache/containerprofilecache/projection_wildcard_classification_test.go

@entlein
entlein force-pushed the fix/projection-star-classification branch from 118857e to db58291 Compare July 25, 2026 11:52
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>
@entlein
entlein force-pushed the fix/projection-star-classification branch from db58291 to c9a11a8 Compare July 25, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant