Skip to content

Centralize Rust guard tool-name constants - #14641

Merged
lpcox merged 4 commits into
mainfrom
copilot/rust-guard-add-tool-names-constants
Oct 9, 2026
Merged

lpcox merged 4 commits into
mainfrom
copilot/rust-guard-add-tool-names-constants

Conversation

Copilot AI commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Tool names for key management, workflow toggles, fork sync, and agent-task creation were duplicated across classification and labeling code. Centralize them in labels::constants::tool_names to keep those references consistent.

  • Constants: Add eight canonical tool-name constants and value assertions.
  • Usage: Replace matching literals in operation lists, label rules, and related tests.
tool_names::ADD_GPG_KEY
    | tool_names::ADD_SSH_KEY
    | tool_names::DELETE_GPG_KEY
    | tool_names::DELETE_SSH_KEY => { /* ... */ }

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tool_names constants for GPG/SSH key and workflow-toggle tools Centralize Rust guard tool-name constants Oct 9, 2026
Copilot AI requested a review from lpcox October 9, 2026 20:07
@lpcox
lpcox marked this pull request as ready for review October 9, 2026 20:12
Copilot AI balanced review requested due to automatic review settings October 9, 2026 20:12
@lpcox

lpcox commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

@copilot merge main and resolve conflicts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The refactor preserves behavior, removes the targeted duplicated literals, and includes matching assertions.

0 open findings

What changed in this PR

Centralizes eight Rust guard tool names to prevent classification and labeling drift.

Changes:

  • Adds canonical tool-name constants and value assertions.
  • Replaces duplicated literals across operation lists, label rules, and tests.
File Description
guards/​github-guard/​rust-guard/​src/​tools.rs Uses constants in operation buckets and tests.
guards/​github-guard/​rust-guard/​src/​labels/​tool_rules.rs Uses constants in labeling rules and tests.
guards/​github-guard/​rust-guard/​src/​labels/​mod.rs Updates the agent-task test reference.
guards/​github-guard/​rust-guard/​src/​labels/​constants.rs Defines and validates eight canonical names.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…d-tool-names-constants

# Conflicts:
#	guards/github-guard/rust-guard/src/tools.rs

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

Copilot AI commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and resolve conflicts

Merged main and resolved the conflicts, retaining both the centralized tool-name constants and main’s additions. Merge commit: 744cf95. make agent-finished passed.

@lpcox

lpcox commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

@copilot merge main and resolve conflicts

…d-tool-names-constants

# Conflicts:
#	guards/github-guard/rust-guard/src/labels/mod.rs

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

Copilot AI commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

@copilot merge main and resolve conflicts

Merged the latest main and resolved the conflict, preserving tool_names::CREATE_AGENT_TASK. Merge commit: 2324258; make agent-finished passed.

@copilot merge main and resolve conflicts

Merged the latest main and resolved the conflict, preserving tool_names::CREATE_AGENT_TASK. Merge commit: 2324258; make agent-finished passed.

@lpcox
lpcox merged commit e40f480 into main Oct 9, 2026
30 checks passed
@lpcox
lpcox deleted the copilot/rust-guard-add-tool-names-constants branch October 9, 2026 20: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] Add tool_names constants for GPG/SSH key and workflow-toggle tools

3 participants