Skip to content

[issue-check] Add closed issue reference check agentic workflow - #130124

Merged
kotlarmilos merged 19 commits into
dotnet:mainfrom
kotlarmilos:kotlarmilos/closed-issue-reference-check
Jul 15, 2026
Merged

kotlarmilos merged 19 commits into
dotnet:mainfrom
kotlarmilos:kotlarmilos/closed-issue-reference-check

Conversation

@kotlarmilos

@kotlarmilos kotlarmilos commented Jul 2, 2026 •

Copy link
Copy Markdown
Member

Description

Adds a scheduled gh-aw workflow that finds closed issues still referenced by test-disabling or build-guarding constructs under src. The deterministic scan accepts only positive issue numbers, classifies ActiveIssue only when it appears in an executable attribute, ignores commented-out attributes and plain comments, resolves issue state through GraphQL, and records total_count while retaining at most 15 reference locations per issue. The agent inspects the surrounding code and posts deduplicated advisory comments through safe-outputs, capped at five comments per run. The workflow uses the current isolated copilot-pat-pool configuration, runs weekly or through manual dispatch, and remains gated to dotnet/runtime.

Adds a scheduled gh-aw workflow that reconciles closed issues with the
code that still references them. A deterministic pre-step greps the
source tree for issue references, batch-resolves each issue's state via
GraphQL, and keeps the closed ones; the agent re-checks every candidate
through the integrity-gated github MCP tools and posts one advisory
comment recommending the issue be reopened or the stale reference
removed. Advisory-only (comment via safe-outputs, capped and deduplicated
on a hidden marker), runs weekly plus on manual dispatch.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings July 2, 2026 13:15
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-meta
See info in area-owners.md if you want to be subscribed.

@kotlarmilos
kotlarmilos requested review from jkotas and vitek-karas July 2, 2026 13:19
@kotlarmilos kotlarmilos changed the title [issue-check] Add Closed Issue Reference Check agentic workflow [issue-check] Add closed issue reference check agentic workflow Jul 2, 2026

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

Adds a new GitHub Agentic Workflows (gh-aw) scheduled workflow that scans the src/ tree for dotnet/runtime/issues/<n> references, resolves the referenced issues’ states via GraphQL, and (via an integrity-gated MCP read) advises on closed issues that are still referenced by posting a single deduplicated comment.

Changes:

  • Introduces closed-issue-reference-check.md defining the workflow, deterministic scan step, and the agent prompt/guardrails.
  • Adds the compiled closed-issue-reference-check.lock.yml workflow generated by gh aw compile.
Show a summary per file
File Description
.github/workflows/closed-issue-reference-check.md Defines the new scheduled workflow, including the deterministic scan + GraphQL resolution and the agent prompt for advisory comments.
.github/workflows/closed-issue-reference-check.lock.yml Compiled lock workflow that implements the md-defined agentic workflow in GitHub Actions jobs/steps.

Copilot's findings

  • Files reviewed: 1/2 changed files
  • Comments generated: 2

Copilot AI review requested due to automatic review settings July 2, 2026 13:20

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.

Copilot's findings

  • Files reviewed: 1/2 changed files
  • Comments generated: 2

kotlarmilos and others added 2 commits July 2, 2026 15:36
Regenerate closed-issue-reference-check.lock.yml with gh-aw v0.74.8 to match
the repo's other locks: SHA-pinned gh-aw-actions/setup@efa55847 (from
actions-lock.json), no unresolved action refs. Re-apply the pat_pool patch on
the detection job (gh-aw dotnet#30232).

Co-authored-by: Copilot <[email protected]>
… tolerate no-match grep

- grep -o captures every issue URL per source line (was only the first)
- emit_query aborts on real GraphQL errors instead of silently yielding an
  empty set (false 'no closed issues'), while still tolerating per-alias
  NOT_FOUND for PR numbers
- grep no-match (exit 1) no longer aborts the scan under set -euo pipefail

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings July 2, 2026 14:00
Align with the repo's active agentic workflows (ci-failure-scan/-fix/-feedback).

Co-authored-by: Copilot <[email protected]>

@vitek-karas vitek-karas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good - thanks!

…c step

Move the marker-based dedup out of the agent prompt into the scan script: rank
all closed referenced issues, then drop any already carrying the advisory
marker, keeping up to MAX fresh candidates. The agent no longer reasons about
issues it would only skip.

Co-authored-by: Copilot <[email protected]>

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.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 4

Copilot AI review requested due to automatic review settings July 2, 2026 14:05

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.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

@jkotas

jkotas commented Jul 2, 2026

Copy link
Copy Markdown
Member

Is there an example of what this produces currently?

Copilot AI review requested due to automatic review settings July 3, 2026 12:14

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.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

The compiled safe-outputs tool is add_comment (underscore); the prompt referred
to it as add-comment, which would emit a missing-tool output instead of posting.

Co-authored-by: Copilot <[email protected]>
@kotlarmilos

kotlarmilos commented Jul 3, 2026 •

Copy link
Copy Markdown
Member Author

Dry-run results

Ran the scan locally over src/libraries/System.Runtime and src/libraries/tests.proj:

scan: 114 referenced issue numbers under src/libraries/System.Runtime src/libraries/tests.proj; resolving state for 114
scan: 12 closed issue(s) still referenced and not yet advised -> issue-candidates.json

Raw artifact the workflow produces in issue-candidates.json:

[
  {
    "number": 55117,
    "url": "https://github.com/dotnet/runtime/issues/55117",
    "title": "[iOS] Failures in System.Dynamic.Runtime.Test library test suite",
    "refs": [
      { "location": "src/libraries/System.Runtime/tests/System.Dynamic.Runtime.Tests/Dynamic.Context/Conformance.dynamic.context.operator.compound.basic.cs:246", "kind": "ActiveIssue" },
      { "location": "src/libraries/System.Runtime/tests/System.Dynamic.Runtime.Tests/Dynamic.Declarations/Conformance.dynamic.declarations.formalParameter.Methods.cs:118", "kind": "ActiveIssue" },
      { "location": "src/libraries/System.Runtime/tests/System.Dynamic.Runtime.Tests/Dynamic.Declarations/Conformance.dynamic.declarations.formalParameter.Methods.cs:207", "kind": "ActiveIssue" }
      // 15 refs total
    ]
  },
  {
    "number": 97833,
    "url": "https://github.com/dotnet/runtime/issues/97833",
    "title": "Setting/getting a function pointer field with reflection not supported",
    "refs": [
      { "location": "src/libraries/System.Runtime/tests/System.Reflection.Tests/FieldInfoTests.cs:115", "kind": "ActiveIssue" },
      { "location": "src/libraries/System.Runtime/tests/System.Reflection.Tests/FieldInfoTests.cs:277", "kind": "ActiveIssue" }
    ]
  },
  {
    "number": 50724,
    "url": "https://github.com/dotnet/runtime/issues/50724",
    "title": "[wasm][tests][eat] Multiple test failures with EnableAggressiveTrimming",
    "refs": [
      { "location": "src/libraries/tests.proj:362", "kind": "build-exclusion" }
    ]
  }
]

Suggested completions the agent would post

On #55117 — closed, referenced by [ActiveIssue(...)] at Conformance.dynamic.context.operator.compound.basic.cs:246:

[ActiveIssue("https://github.com/dotnet/runtime/issues/55117", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]

Closed issue referenced by a test-disabling or guarding construct. An [ActiveIssue(...)] must only reference an active issue, so if one points here the issue should be reopened or the attribute removed and the test re-enabled. A Skip or project exclusion should state its reason in the code rather than rely on the issue link — make it self-describing, or reopen the issue if it was not actually fixed.

Referenced at:

  • src/libraries/System.Runtime/tests/System.Dynamic.Runtime.Tests/Dynamic.Context/Conformance.dynamic.context.operator.compound.basic.cs:246 — ActiveIssue
  • src/libraries/System.Runtime/tests/System.Dynamic.Runtime.Tests/Dynamic.Declarations/Conformance.dynamic.declarations.formalParameter.Methods.cs:118 — ActiveIssue
  • …13 more references

On #50724 — closed, referenced by the <!-- Issue: … --> exclusion at tests.proj:362 with no stated reason:

Closed issue referenced by a test-disabling or guarding construct. An [ActiveIssue(...)] must only reference an active issue, so if one points here the issue should be reopened or the attribute removed and the test re-enabled. A Skip or project exclusion should state its reason in the code rather than rely on the issue link — make it self-describing, or reopen the issue if it was not actually fixed.

Referenced at:

  • src/libraries/tests.proj:362 — build-exclusion

Copilot AI review requested due to automatic review settings July 3, 2026 13:25
@kotlarmilos
kotlarmilos marked this pull request as ready for review July 3, 2026 13:26
@kotlarmilos
kotlarmilos requested review from a team and jeffhandley as code owners July 3, 2026 13:26

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.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

kotlarmilos and others added 3 commits July 3, 2026 15:46
Replaces the --paginate download of an issue's entire comment history with a
reverse walk that stops as soon as the advisory marker is found, so typical
already-advised issues read one page instead of all of them. Marker detection is
unchanged; a REST failure still aborts the run rather than re-advising.

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>

Copilot-Session: ded98f7e-9fed-456d-94a0-872433ca1374
Copilot AI review requested due to automatic review settings July 13, 2026 12:07
@kotlarmilos

kotlarmilos commented Jul 13, 2026 •

Copy link
Copy Markdown
Member Author

Updated the branch to current main and regenerated the lock file with gh-aw v0.81.6. The full deterministic scan over src found 605 relevant issue numbers, resolved 508, and produced five capped candidates

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.

Copilot's findings

  • Files reviewed: 1/2 changed files
  • Comments generated: 1

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 8871f8da-e894-43e2-8c85-214b4df969fd
Copilot AI review requested due to automatic review settings July 13, 2026 13:14
@kotlarmilos
kotlarmilos enabled auto-merge (squash) July 13, 2026 13:19
@kotlarmilos
kotlarmilos requested a review from vitek-karas July 13, 2026 13:19

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@kotlarmilos
kotlarmilos merged commit bed63f5 into dotnet:main Jul 15, 2026
29 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 16, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants