Skip to content

Add explicit DIFC labeling for list_issue_fields in GitHub guard#6637

Merged
lpcox merged 4 commits into
mainfrom
copilot/guard-coverage-fix
May 28, 2026
Merged

Add explicit DIFC labeling for list_issue_fields in GitHub guard#6637
lpcox merged 4 commits into
mainfrom
copilot/guard-coverage-fix

Conversation

Copilot AI commented May 28, 2026

Copy link
Copy Markdown
Contributor

The guard had a coverage gap for list_issue_fields: it lacked an explicit apply_tool_labels arm and fell through to default label inheritance. This left org/project issue field metadata without the intended project:github integrity constraints.

  • DIFC rule coverage

    • Added a dedicated list_issue_fields match arm in tool_rules.rs.
    • Aligned integrity behavior with list_issue_types by applying project_github_label(ctx).
  • Regression protection

    • Added a focused unit test in labels/mod.rs to assert list_issue_fields resolves to the same integrity labels as list_issue_types.
"list_issue_types" => {
    integrity = project_github_label(ctx);
}
"list_issue_fields" => {
    integrity = project_github_label(ctx);
}

Copilot AI changed the title [WIP] Fix guard coverage gap for list_issue_fields operation Add explicit DIFC labeling for list_issue_fields in GitHub guard May 28, 2026
Copilot finished work on behalf of lpcox May 28, 2026 15:57
Copilot AI requested a review from lpcox May 28, 2026 15:57
@lpcox lpcox marked this pull request as ready for review May 28, 2026 15:59
Copilot AI review requested due to automatic review settings May 28, 2026 16:00

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.

Pull request overview

This PR closes a DIFC labeling gap by giving list_issue_fields an explicit GitHub guard rule aligned with list_issue_types.

Changes:

  • Adds a list_issue_fields arm in apply_tool_labels.
  • Applies GitHub-global project integrity labels to issue field metadata.
  • Adds a regression test comparing list_issue_fields and list_issue_types integrity behavior.
Show a summary per file
File Description
guards/github-guard/rust-guard/src/labels/tool_rules.rs Adds the explicit labeling rule for list_issue_fields.
guards/github-guard/rust-guard/src/labels/mod.rs Adds a focused unit test for the new rule.

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: 2

Comment thread guards/github-guard/rust-guard/src/labels/tool_rules.rs Outdated
Comment on lines +452 to +456
"list_issue_fields" => {
// Org-level custom issue field definitions (field names/types/allowed values)
// S = inherits from org
// I = project:org - maintained by org admins
integrity = project_github_label(ctx);
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot finished work on behalf of lpcox May 28, 2026 16:16
@lpcox lpcox merged commit 52cbdf5 into main May 28, 2026
16 checks passed
@lpcox lpcox deleted the copilot/guard-coverage-fix branch May 28, 2026 16:28
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.

[guard-coverage] Guard coverage gap: 1 operation from github-mcp-server not fully covered

3 participants