Repository navigation
analysis(classify): fail closed on unscopable absolute related-test paths (#3235) - #3247
Conversation
…aths (#3235) package_prefix returns None for absolute or drive-prefixed paths without a crates/ segment, and find_related_tests treated that None as "no scoping needed" — silently disabling the package guard so a wrong-package name/token coincidence could be admitted as related. The supported pipeline never supplies those shapes (discovery strips the workspace root; the RustAdapter passes the relative identities into the index), so this is a defensive gap for direct/internal callers, flagged by the ripr#1543 review. Extract one path_is_absolute_form authority (Unix-rooted, drive-prefixed, or host-absolute) shared by package_prefix and the guards. When the owner/probe path is unscopable-absolute AND the candidate test's path is also absolute, no package comparison is possible: weak matches fail closed, and only the strong uniquely-owned call path (#2971) admits. A relative test file keeps current behavior — the production-pinned mixed-form companion flow (absolute probe, relative test files) is unchanged, as is relative and crates/<name>/ scoping. Also pin the discovery boundary the audit relied on: discover_rust_files_returns_repo_relative_identities proves every discovered identity is repo-relative on every host. Discriminating power proven by scratch-disabling the guards (all three new filters fail). Zero golden drift; related_tests suite 99 passed; dogfood green. Closes #3235
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reached
Next review available in: 100 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. 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)
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39a70c8de5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…aths (#3235) Restores the classifier half of #3235 lost from the previous commit (the review caught that only the discovery pin had landed): extract one path_is_absolute_form authority shared by package_prefix and the guards, and when the owner/probe path is absolute without a crates/ segment AND the candidate test's path is also absolute, weak matches fail closed — only the strong uniquely-owned call path (#2971) admits. A relative test file keeps current behavior (the production-pinned mixed-form companion flow), as do relative-marker and crates/<name>/ scoping.
|
Correct — the previous commit had lost the classifier half: a |
…review) check-local-context correctly flags literal drive-letter paths in source; construct the Windows-form tokens at runtime like #3231 does.
Change
Closes the defensive gap in
find_related_testspackage scoping (#3235):package_prefixreturnsNonefor absolute or drive-prefixed paths without acrates/segment, and the classifier treated thatNoneas "no scoping needed" — silently disabling the package guard, so a wrong-package name/token coincidence could be admitted as related. The supported pipeline never supplies those shapes (discovery strips the workspace root;RustAdapterpasses relative identities into the index), so this hardens against direct/internal and future callers, per the issue's ruling.path_is_absolute_formauthority (Unix-rooted, Windows drive-prefixed, or host-absolute), shared bypackage_prefixand the package guards.absolute_root_probe_matches_relative_companion_test_file) is unchanged, as are relative-marker andcrates/<name>/scoping.discover_rust_files_returns_repo_relative_identitiesproves every discovered identity is repo-relative on every host (the acceptance's production-path test).Proof
DirectOwnerCall) across absolute paths.test_with_callwith a non-owner call name) — a fixture that actually calls the owner legitimately fires the slice(#2664-A): allow cross-crate test match when calls_owner signal is true (minimal fix) #2971 bypass and is the retained positive control.cargo xtask goldens checkexit 0);cargo xtask dogfoodexit 0.Verification
cargo test -p ripr --lib -- related_tests discover— 120 passed (5 new + strengthened discovery pin)cargo fmt --check,cargo clippy -p ripr --all-targets -- -D warnings,cargo xtask precommit— passCloses #3235