Repository navigation
Extract pure sensitive-path predicate from Rust guard label logic - #15628
Merged
Merged
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Extract pure is_sensitive_path predicate from check_file_secrecy
Extract pure sensitive-path predicate from Rust guard label logic
Oct 27, 2026
lpcox
marked this pull request as ready for review
October 27, 2026 15:39
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused extraction preserves existing behavior and test coverage, with only an optional documentation clarification remaining.
No open issues 🎉
What changed in this PR
Separates sensitive-path detection from policy-dependent secrecy labeling in the Rust guard, improving testability without changing matching behavior.
Changes:
- Extracts the pure
is_sensitive_pathpredicate. - Consolidates existing cases into a table-driven test and adds boundary coverage.
- Retains two label-wiring tests and strengthens the unchanged-default check.
| File | Description |
|---|---|
guards/github-guard/rust-guard/src/labels/tool_rules.rs |
Extracts path classification and reorganizes tests while preserving secrecy-label behavior. |
Review effort: Max
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
check_file_secrecycouples path classification with policy-dependent label construction, requiring policy fixtures to test string-matching rules.is_sensitive_path(&str) -> bool; preserve matching behavior and leave label selection incheck_file_secrecy.is_sensitive_pathpredicate fromcheck_file_secrecy#15615