Repository navigation
Avoid discarded repository identifier allocations in Rust guard labeling - #16457
Merged
Merged
Conversation
…bels Co-authored-by: lpcox <[email protected]>
Copilot
AI
changed the title
[WIP] Add repo_full_with_secrecy helper to reduce discarded String allocations
Avoid discarded repository identifier allocations in Rust guard labeling
Nov 13, 2026
lpcox
marked this pull request as ready for review
November 13, 2026 15:39
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the allocation-reducing changes to Rust guard response labeling.
No open issues 🎉
What changed in this PR
Reduces temporary string allocations in Rust guard response labeling while preserving repository identifiers and visibility-derived secrecy labels.
Changes:
- Adds
repo_full_with_secrecyand migrates all 12 callers that discarded owner and repository strings. - Borrows fields directly in project-item labeling and pull-request integrity checks.
- Adds equivalence tests covering visibility states and missing or malformed repository arguments.
| File | Description |
|---|---|
guards/github-guard/rust-guard/src/labels/response_paths.rs |
Uses the new helper and borrows the project owner. |
guards/github-guard/rust-guard/src/labels/response_items.rs |
Migrates item labelers to the allocation-saving helper. |
guards/github-guard/rust-guard/src/labels/helpers.rs |
Adds the helper, removes integrity-check allocations, and adds regression tests. |
Review effort: Max (dynamic)
This was referenced Nov 13, 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.
Twelve response-labeling call sites allocate owner/repo strings only to discard them. This refactor borrows those fields while preserving repository IDs and visibility-derived secrecy labels.
repo_full_with_secrecy, migrate all 12 callers, and reuse it in the test-only four-value helper.