Skip to content

Refactor policy bot rules into separate files#663

Open
denelon wants to merge 5 commits intomicrosoft:mainfrom
denelon:denelon/policy-bot-refactor
Open

Refactor policy bot rules into separate files#663
denelon wants to merge 5 commits intomicrosoft:mainfrom
denelon:denelon/policy-bot-refactor

Conversation

@denelon
Copy link
Copy Markdown
Collaborator

@denelon denelon commented May 3, 2026

📖 Description

Refactors the Policy Bot rules from one monolithic configuration into separate files by concern. Removes the unused automergeTriggers rules, simplifies issueClosed, and adds the intended (?in) regex behavior for the Duplicate handling pattern.

Changed files

  • .github/policies/labelAdded.noRecentActivity.yml
  • .github/policies/labelManagement.issueClosed.yml
  • .github/policies/labelManagement.issueOpened.yml
  • .github/policies/labelManagement.issueUpdated.yml
  • .github/policies/moderatorTriggers.yml
  • .github/policies/resourceManagement.yml
  • .github/policies/scheduledSearch.closeNoRecentActivity.yml
  • .github/policies/scheduledSearch.markNoRecentActivity.yml

Created with GitHub Copilot assistance.

🔗 References

Resolves #666

🔍 Validation

  • Reviewed the split Policy Bot files to confirm the rule changes are present in the expected files.

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task

Comment thread .github/policies/automergeTriggers.yml Outdated
Comment thread .github/policies/labelManagement.issueClosed.yml
Comment thread .github/policies/moderatorTriggers.yml Outdated
Split the monolithic resourceManagement.yml into 8 focused files matching
the pattern used in winget-cli and winget-dsc:

- scheduledSearch.markNoRecentActivity.yml
- scheduledSearch.closeNoRecentActivity.yml
- labelAdded.noRecentActivity.yml
- labelManagement.issueOpened.yml
- labelManagement.issueUpdated.yml
- labelManagement.issueClosed.yml (new — labels were not cleaned on close)
- moderatorTriggers.yml
- automergeTriggers.yml

Behavioral improvements:
- Add Blocking-Issue and Issue-Feature exemptions to stale issue closure
- Add cleanEmailReply for Pull_Request_Review_Comment payloads
- Add label cleanup on issue and PR close (previously missing)
- Split stale warning replies into labelAdded responder for cleaner separation
- Add descriptions to all rules for maintainability

All existing behavior preserved: stale timers (7+7 days), duplicate close
flow, Resolution-Duplicate auto-close (1 day), Feedback Hub flow, empty
body issue close, label sync, inPrLabel, automerge, and CodeFlow links.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@denelon denelon force-pushed the denelon/policy-bot-refactor branch from 89f7f8f to c75f560 Compare May 4, 2026 03:02
@denelon denelon marked this pull request as ready for review May 4, 2026 03:03
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.

Refactor policy bot rules into separate files

2 participants