Skip to content

Commit ab3073c

Browse files
lpcoxCopilotCopilot
authored
fix: scanner workflows now check closed issues with state_reason-aware dedup (#2740)
* fix: scanner workflows now check closed issues to prevent re-filing Update dedup logic in refactoring-scanner, export-audit, and duplicate-code-detector to search both open AND closed issues before filing new ones. Previously they only checked open issues, so findings that were triaged and closed as 'not planned' would be re-filed on the next scheduled run. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: refine scanner dedup guidance for closed issue handling * fix: align scanner dedup rules with GitHub state_reason semantics --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 4564c0a commit ab3073c

6 files changed

Lines changed: 38 additions & 35 deletions

File tree

.github/workflows/duplicate-code-detector.lock.yml

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/duplicate-code-detector.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,12 @@ cat containers/api-proxy/proxy-utils.js 2>/dev/null | head -60
152152

153153
## Phase 5: Check for Existing Issues
154154

155-
Before filing new issues, check what's already been reported:
155+
Before filing new issues, check BOTH open AND closed issues:
156156

157-
1. Search for open issues with `[Duplicate Code]` prefix using the GitHub toolset
158-
2. Also search for issues with labels `code-quality` or `refactoring` that describe duplication
157+
1. Search for issues with `[Duplicate Code]` prefix using the GitHub toolset with `state: all` (or equivalent `is:open` + `is:closed`)
158+
2. Also search for issues with labels `code-quality` or `refactoring` that describe duplication using `state: all` (or equivalent `is:open` + `is:closed`)
159159
3. Skip any finding that already has an open tracking issue
160+
4. For matching closed issues, check the GitHub `state_reason`: **auto-skip only when `state_reason` is `not_planned`** (often shown as "won't fix" / "not planned"). If `state_reason` is `completed` and the finding still reproduces, reopen the prior issue or file a new one with fresh evidence and a link to the prior issue.
160161

161162
## Phase 6: Prioritize and Report Findings
162163

@@ -213,7 +214,7 @@ Low / Medium / High
213214
- **Be specific**: Always include file paths and line numbers in the evidence section
214215
- **Be actionable**: Each issue should have a clear, implementable suggestion
215216
- **Avoid noise**: Only file issues for genuine duplication with real maintenance impact — not cosmetic similarities
216-
- **No duplicates**: Check existing open issues before creating new ones
217+
- **No duplicates**: Check existing issues with `state: all`; only treat closed issues as terminal when `state_reason` is `not_planned`
217218
- **Security awareness**: Flag duplicated security-critical logic (domain validation, ACL rules, capability management) with higher urgency
218219
- **Cap at 5 issues**: File at most 5 issues per run to avoid flooding the tracker
219220

0 commit comments

Comments
 (0)