Files
PowerToys/.github/policies/resourceManagement.yml
Niels Laute 523409ed06 Add AI-assisted PR triage (#49911)
## Summary of the Pull Request

Adds AI-assisted pull request triage using GitHub Agentic Workflows. A
bounded Copilot pass summarizes each PR and classifies screenshots,
GIFs, or video as required, recommended, or unnecessary. Deterministic
publishing validates the exact PR evidence hash, closing issue
references, merge conflicts, draft state, and supplied visual evidence
before updating one canonical comment.

The workflow manages only `Needs-Review` and `Needs-Author-Feedback`.
Missing issue references are advisory; invalid references, merge
conflicts, and missing required visual evidence block readiness.
Existing resource-management automation continues to close inactive PRs
awaiting author feedback.

## PR Checklist

- [ ] Closes: #xxx
- [x] **Communication:** Discussed the intended PR intake flow and
comment format
- [x] **Tests:** Added/updated and all pass
- [x] **Localization:** No product strings added
- [x] **Dev docs:** Added workflow documentation
- [x] **New binaries:** Not applicable
- [x] **Documentation updated:** Repository automation documentation
updated

## Validation Steps Performed

- `node --check .github/scripts/pr-intake/pr-intake.mjs`
- `node --test .github/scripts/pr-intake/tests/pr-intake.test.mjs` — 23
passing
- `gh aw compile pr-intake` with gh-aw v0.86.2
- Read-only preprocessing against PR #49905 confirmed four changed
files, no visual-evidence hint, and `mergeable=false` /
`mergeable_state=dirty` is detected as a blocking conflict

Copilot-Session: 3067a641-aa79-4f96-8d9f-eaa1c6d9b3cf
2026-08-14 21:29:14 +00:00

282 lines
10 KiB
YAML

id:
name: GitOps.PullRequestIssueManagement
description: GitOps.PullRequestIssueManagement primitive
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
scheduledSearches:
- description: Close issues awaiting author feedback after 7 days of inactivity
frequencies:
- hourly:
hour: 6
filters:
- isIssue
- isOpen
- hasLabel:
label: Needs-Author-Feedback
- noActivitySince:
days: 7
actions:
- addReply:
reply: This issue has been automatically closed because it has been marked as requiring author feedback but has not had any activity for **7 days**. If you can provide the requested information, please reopen the issue and add it in a comment.
- closeIssue
- description:
frequencies:
- hourly:
hour: 6
filters:
- isIssue
- isOpen
- hasLabel:
label: Resolution-Duplicate
- noActivitySince:
days: 1
actions:
- addReply:
reply: This issue has been marked as duplicate and has not had any activity for **1 day**. It will be closed for housekeeping purposes.
- closeIssue
# ─── PR Needs-Author-Feedback: close after 7 days of inactivity ───
- description: Close PRs awaiting author feedback after 7 days of inactivity
frequencies:
- hourly:
hour: 6
filters:
- isPullRequest
- isOpen
- hasLabel:
label: Needs-Author-Feedback
- noActivitySince:
days: 7
actions:
- addReply:
reply: This pull request has been automatically closed because it has been marked as requiring author feedback but has not had any activity for **7 days**. If you would like to continue working on it, please reopen the PR and push your changes or leave a comment.
- closeIssue
eventResponderTasks:
# ─── When issue/PR author comments, swap Needs-Author-Feedback → Needs-Triage ───
- if:
- payloadType: Issue_Comment
- isAction:
action: Created
- isActivitySender:
issueAuthor: True
- hasLabel:
label: Needs-Author-Feedback
- isOpen
then:
- addLabel:
label: Needs-Triage
- removeLabel:
label: Needs-Author-Feedback
- addLabel:
label: Needs-Team-Response
description:
# ─── Remove "Status-No recent activity" on any issue update (not close) ───
- if:
- payloadType: Issues
- not:
isAction:
action: Closed
- hasLabel:
label: Status-No recent activity
then:
- removeLabel:
label: Status-No recent activity
description:
# ─── Remove "Status-No recent activity" on any issue comment ───
- if:
- payloadType: Issue_Comment
- hasLabel:
label: Status-No recent activity
then:
- removeLabel:
label: Status-No recent activity
description:
# ─── Remove "Status-No recent activity" on PR updates (push, review, etc.) ───
- if:
- payloadType: Pull_Request
- hasLabel:
label: Status-No recent activity
- isOpen
then:
- removeLabel:
label: Status-No recent activity
description:
- if:
- payloadType: Pull_Request
then:
- inPrLabel:
label: Status-In progress
description:
- if:
- payloadType: Issue_Comment
then:
- cleanEmailReply
description:
- if:
- payloadType: Issue_Comment
- commentContains:
pattern: '\/(bugreport|reportbug)'
isRegex: True
- or:
- activitySenderHasAssociation:
association: Member
- activitySenderHasAssociation:
association: Owner
- activitySenderHasAssociation:
association: Collaborator
then:
- removeLabel:
label: Needs-Triage
- addLabel:
label: Needs-Author-Feedback
- addReply:
reply: Hi there!<br/><br/>We need a bit more information to really debug this issue. Can you add a "Report Bug" zip file here? You right click on our system tray icon and just go to report bug. Then drag the zipfile from your desktop onto the GitHub comment box in this issue. Thanks! <br/>![Report Bug](https://user-images.githubusercontent.com/11349917/133042052-4975be21-4699-4363-83c9-a8e1869d079d.png)
- removeLabel:
label: Needs-Team-Response
description:
- if:
- payloadType: Issue_Comment
- commentContains:
pattern: '\/feedback[H|h]ub'
isRegex: True
- or:
- activitySenderHasAssociation:
association: Owner
- activitySenderHasAssociation:
association: Member
- activitySenderHasAssociation:
association: Collaborator
then:
- addReply:
reply: Hi! We've identified this issue that best is suited for Windows Feedback Hub. To do this on Windows, WinKey+F will bring it up!
- closeIssue
- removeLabel:
label: Needs-Triage
- removeLabel:
label: Needs-Team-Response
- addLabel:
label: Resolution-Please File on Feedback Hub
description:
- if:
- payloadType: Issue_Comment
- commentContains:
pattern: '\/dup(licate|e)?(\s+of)?\s+(\#[\d]+|https)'
isRegex: True
- or:
- activitySenderHasAssociation:
association: Owner
- activitySenderHasAssociation:
association: Member
- activitySenderHasAssociation:
association: Collaborator
then:
- addReply:
reply: We've identified this issue as a duplicate of an existing one and are closing this thread so discussion stays in one place.<br/><br/>Please see the comment above for the link to the original tracking issue, and feel free to subscribe there for updates.
- closeIssue
- removeLabel:
label: Needs-Triage
- removeLabel:
label: Needs-Team-Response
- addLabel:
label: Resolution-Duplicate
description:
- if:
- payloadType: Issue_Comment
- commentContains:
pattern: '\/needinfo'
isRegex: True
- or:
- activitySenderHasAssociation:
association: Owner
- activitySenderHasAssociation:
association: Member
- activitySenderHasAssociation:
association: Collaborator
then:
- removeLabel:
label: Needs-Triage
- removeLabel:
label: Needs-Team-Response
- addLabel:
label: Needs-Author-Feedback
description:
- if:
- payloadType: Issue_Comment
- commentContains:
pattern: '\/helped'
isRegex: True
- or:
- activitySenderHasAssociation:
association: Owner
- activitySenderHasAssociation:
association: Member
- activitySenderHasAssociation:
association: Collaborator
then:
- removeLabel:
label: Needs-Triage
- removeLabel:
label: Needs-Team-Response
- addLabel:
label: Resolution-Helped User
- addReply:
reply: This issue is now marked as resolved. If you have any follow-up questions, please don't hesitate to ask. You can find out more about PowerToys functionalities in our [end-user documentation](https://aka.ms/powertoy-docs).
- closeIssue
description:
- if:
- payloadType: Issue_Comment
- commentContains:
pattern: '\/loc\b'
isRegex: True
- or:
- activitySenderHasAssociation:
association: Owner
- activitySenderHasAssociation:
association: Member
then:
- removeLabel:
label: Needs-Triage
- addLabel:
label: Loc-Sent To Team
- addReply:
reply: Hi! Thanks for making us aware of the problem. We raised the issue with our internal localization team. This issue should be fixed hopefully in the next version of PowerToys.
description:
- if:
- payloadType: Issue_Comment
- commentContains:
pattern: '\/need-monitor-info'
isRegex: True
- hasLabel:
label: Product-Cursor Wrap
- or:
- activitySenderHasAssociation:
association: Owner
- activitySenderHasAssociation:
association: Member
- activitySenderHasAssociation:
association: Collaborator
then:
- removeLabel:
label: Needs-Triage
- removeLabel:
label: Needs-Team-Response
- addLabel:
label: Needs-Author-Feedback
- addReply:
reply: "To help debug your layout, please run [this script](https://github.com/microsoft/PowerToys/blob/main/src/modules/MouseUtils/CursorWrap/CursorWrapTests/Capture-MonitorLayout.ps1) and attach the generated JSON output to this thread.\n\nThis allows us to better understand the issue and investigate potential fixes."
description:
- if:
- payloadType: Issue_Comment
- commentContains:
pattern: "I(( would|'d) (like|love|be happy)| want) (to help|helping|to contribute|contributing|to implement|implementing|to fix|fixing)"
isRegex: True
then:
- addReply:
reply: Hi! Your last comment indicates to our system, that you might want to contribute to this feature/fix this bug. Thank you! Please make us aware on our ["Would you like to contribute to PowerToys?" thread](https://github.com/microsoft/PowerToys/issues/28769), as we don't see all the comments. <br /><br />_I'm a bot (beep!) so please excuse any mistakes I may make_
description:
onFailure:
onSuccess: