Skip to content

Commit b8fc6d4

Browse files
CopilotlpcoxCopilot
authored
Reduce Refactoring Scanner AI-credit burn from duplicate-issue lookups (#5125)
* Initial plan * fix: reduce refactoring scanner issue-query context * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Landon Cox <landon.cox@microsoft.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent a9b6b2c commit b8fc6d4

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/refactoring-scanner.lock.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/refactoring-scanner.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,9 @@ Before creating new issues, check BOTH open AND closed issues:
184184

185185
1. Search for issues with `[Refactoring]` prefix mentioning the same file using `state: all` (or equivalent `is:open` + `is:closed`)
186186
2. Search for issues with labels `code-quality` or `refactoring` mentioning the same file using `state: all` (or equivalent `is:open` + `is:closed`)
187-
3. Skip any finding that already has an open tracking issue
188-
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.
187+
3. Use metadata-only issue queries (number/title/state/stateReason/labels/url). **Do not fetch issue bodies** unless strictly required.
188+
4. Skip any finding that already has an open tracking issue
189+
5. For matching closed issues, check GitHub `stateReason` (`state_reason` in REST): **auto-skip only when the reason is "not planned" (`NOT_PLANNED` / `not_planned`)** (often shown as "won't fix" / "not planned"). If the reason is "completed" (`COMPLETED` / `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.
189190

190191
## Phase 6: Prioritize and File Issues
191192

0 commit comments

Comments
 (0)