Conversation
…nd narrow pub use exports Agent-Logs-Url: https://github.com/github/gh-aw-mcpg/sessions/dbcc6e5b-6004-41c8-aab6-e8f9180b8623 Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Merge duplicate search_issues and search_pull_requests match arms
rust-guard: merge duplicate search_issues/search_pull_requests arms; narrow labels pub use
Apr 15, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Maintenance refactor in rust-guard to reduce duplication in tool labeling logic and to narrow the public re-export surface of the labels module.
Changes:
- Merged identical
search_issuesandsearch_pull_requestsmatch arms into a single combined arm inapply_tool_labels. - Reduced
labelspublic API by removing internal JSON helper utilities frompub use, and imported them explicitly in the test module where needed.
Show a summary per file
| File | Description |
|---|---|
guards/github-guard/rust-guard/src/labels/tool_rules.rs |
Deduplicates search tool match arms while preserving desc output via tool_name. |
guards/github-guard/rust-guard/src/labels/mod.rs |
Narrows pub use helpers::{...} surface and fixes test-only usage with explicit helpers imports. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
This was referenced Apr 15, 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.
Two maintenance improvements to
rust-guard: eliminate a duplicated match arm that required every future change to be applied twice, and narrow thelabelsmodule's re-export surface by removing low-level JSON utilities that were only ever used internally.Changes
labels/tool_rules.rs— Merge the byte-for-byte identical"search_issues"and"search_pull_requests"match arms into one, using the in-scopetool_namefor thedescprefix:labels/mod.rs— Removeget_str_or,get_nested_str,get_bool_or,make_item_path, andhas_author_associationfrom the top-levelpub use helpers::{...}block; add explicit imports for them inside#[cfg(test)] mod testswhere they are actually consumed. These utilities are never referenced outside thelabels/submodule tree.