Skip to content

rust-guard: merge duplicate search_issues/search_pull_requests arms; narrow labels pub use#3858

Merged
lpcox merged 2 commits intomainfrom
copilot/rust-guard-merge-duplicate-search-arms
Apr 15, 2026
Merged

rust-guard: merge duplicate search_issues/search_pull_requests arms; narrow labels pub use#3858
lpcox merged 2 commits intomainfrom
copilot/rust-guard-merge-duplicate-search-arms

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 15, 2026

Two maintenance improvements to rust-guard: eliminate a duplicated match arm that required every future change to be applied twice, and narrow the labels module'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-scope tool_name for the desc prefix:

    // Before: two identical ~14-line arms
    "search_issues" => { desc = format!("search_issues:{}", s_repo_id); ... }
    "search_pull_requests" => { desc = format!("search_pull_requests:{}", s_repo_id); ... }
    
    // After: single arm, same output strings
    "search_issues" | "search_pull_requests" => {
        desc = format!("{}:{}", tool_name, s_repo_id);
        ...
    }
  • labels/mod.rs — Remove get_str_or, get_nested_str, get_bool_or, make_item_path, and has_author_association from the top-level pub use helpers::{...} block; add explicit imports for them inside #[cfg(test)] mod tests where they are actually consumed. These utilities are never referenced outside the labels/ submodule tree.

…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
Copilot AI requested a review from lpcox April 15, 2026 14:07
@lpcox lpcox marked this pull request as ready for review April 15, 2026 14:32
Copilot AI review requested due to automatic review settings April 15, 2026 14:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_issues and search_pull_requests match arms into a single combined arm in apply_tool_labels.
  • Reduced labels public API by removing internal JSON helper utilities from pub 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

@lpcox lpcox merged commit 432b727 into main Apr 15, 2026
30 checks passed
@lpcox lpcox deleted the copilot/rust-guard-merge-duplicate-search-arms branch April 15, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[rust-guard] Rust Guard: Merge duplicate search_issues / search_pull_requests match arms

3 participants