Repository navigation
[Repo Assist] refactor(rust-guard): borrow integrity slices and merge duplicate USER scope arms - #16920
Conversation
…R scope arms Closes #16911 Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The review found no actionable issues in the behavior-preserving refactors to borrowed integrity-label slices and consolidated scope matching.
No open issues 🎉
What changed in this PR
This PR makes two behavior-preserving Rust Guard refactors that reduce unnecessary ownership transfers and remove duplicated match-arm logic.
Changes:
- Changes integrity helper parameters from owned vectors to borrowed slices and updates all four callers.
- Merges notification/star and Codespaces
USERscope patterns ininfer_scope_for_baseline. - No actionable issues were identified.
| File | Description |
|---|---|
| guards/github-guard/rust-guard/src/lib.rs | Consolidates equivalent USER scope match arms while preserving repository-creation handling. |
| guards/github-guard/rust-guard/src/labels/helpers.rs | Borrows integrity labels in promotion and demotion helpers, avoiding unnecessary vector moves. |
Review effort: Lite (adaptive)
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE No write or mutation was attempted or leaked in this run. Parts A and C (reads) fully PASS. Part B is inconclusive because gh-aw's
|
🤖 This is an automated PR from Repo Assist.
Closes #16911
Changes
labels/helpers.rs:promote_to_writer/demote_to_nonenow takeintegrity: &[String]instead ofVec<String>(they only read it); the four call sites pass&integrity. Clears clippyneedless_pass_by_value.lib.rs: merged the two identicalscope_names::USERarms ininfer_scope_for_baseline(notification/star tools + codespace tools). All patterns are distinct, so matching is unchanged.Behavior-preserving.
Test Status
cargo build: passcargo test --lib: 730/730 passcargo clippy: cleancargo fmt --check: only the pre-existing diff atlib.rs~line 2034 (test tuple wrapping), unrelated and left untouched.Add this agentic workflow to your repo
To install this agentic workflow, run