Skip to content

Commit

Permalink
Close PRs with Blocking-Issue automatically (microsoft#193745)
Browse files Browse the repository at this point in the history
  • Loading branch information
Trenly authored Dec 18, 2024
1 parent 245cea1 commit 54abb12
Show file tree
Hide file tree
Showing 7 changed files with 278 additions and 72 deletions.
78 changes: 78 additions & 0 deletions .github/policies/labelAdded.driverInstall.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
id: labelAdded.driverInstall
name: GitOps.PullRequestIssueManagement
description: Handlers when "DriverInstall" label is added
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: >-
When the label "DriverInstall" is added to a pull request
* Add the PR specific reply notifying the issue author of a blocking issue
* Label the PR with Blocking-Issue
* Label with Needs-Author-Feedback
* Remove the Needs-Attention Label
if:
- payloadType: Pull_Request
- labelAdded:
label: DriverInstall
then:
- addReply:
reply: >-
Hello @${issueAuthor},
This package appears to require user interaction to install.
This PR is blocked until support for interactive installer search filtering is implemented in:
* microsoft/winget-cli/issues/823
Be sure to add your 👍 to the issue to help raise the priority and avoid posting "Me too!" messages to respect those who have subscribed to the issue.
Template: msftbot/blockingIssue/interactiveOnlyInstall
- addLabel:
label: Blocking-Issue
- addLabel:
label: Needs-Author-Feedback
- removeLabel:
label: Needs-Attention
# The policy service should trigger even when the label was added by the policy service
triggerOnOwnActions: true
- description: >-
When the label "DriverInstall" is added to an issue
* Add the issue specific reply notifying the issue author of a blocking issue
* Label the issue with Blocking-Issue
if:
- payloadType: Issues
- labelAdded:
label: DriverInstall
then:
- addReply:
reply: >-
Hello @${issueAuthor},
This package appears to require user interaction to install.
This package is blocked until support for interactive installer search filtering is implemented in:
* microsoft/winget-cli/issues/823
Be sure to add your 👍 to the issue to help raise the priority and avoid posting "Me too!" messages to respect those who have subscribed to the issue.
Template: msftbot/blockingIssue/interactiveOnlyInstall
- addLabel:
label: Blocking-Issue
# The policy service should trigger even when the label was added by the policy service
triggerOnOwnActions: true
onFailure:
onSuccess:
40 changes: 40 additions & 0 deletions .github/policies/labelAdded.networkBlocker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
id: labelAdded.networkBlocker
name: GitOps.PullRequestIssueManagement
description: Handlers when "Network-Blocker" label is added
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: >-
When the label "Network-Blocker" is added to a pull request
* Add the PR specific reply notifying the issue author
* Assign to the Author
* Label with Blocking-Issue
* Label with Needs-Author-Feedback
if:
- payloadType: Pull_Request
- labelAdded:
label: Network-Blocker
then:
- addReply:
reply: >-
Hello @${issueAuthor},
The URLs provided were not reachable by the validation pipelines. This may be due to the publisher blocking the IP ranges used during validation or some other network blocker. This PR cannot be validated until the publisher adds WinGet to an allow list or removes the issue blocking the network connection. Please reach out to the publisher regarding this issue.
Template: msftbot/validationError/urls/networkBlocker
- assignTo:
author: True
- addLabel:
label: Blocking-Issue
- addLabel:
label: Needs-Author-Feedback
# The policy service should trigger even when the label was added by the policy service
triggerOnOwnActions: true
onFailure:
onSuccess:
78 changes: 78 additions & 0 deletions .github/policies/labelAdded.portableJar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
id: labelAdded.portableJar
name: GitOps.PullRequestIssueManagement
description: Handlers when "portable-jar" label is added
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: >-
When the label "portable-jar" is added to a pull request
* Add the PR specific reply notifying the issue author of a blocking issue
* Label the PR with Blocking-Issue
* Label with Needs-Author-Feedback
* Remove the Needs-Attention Label
if:
- payloadType: Pull_Request
- labelAdded:
label: portable-jar
then:
- addReply:
reply: >-
Hello @${issueAuthor},
This package appears to require support for non-EXE files packaged inside an archive.
This PR is blocked until support for non-EXE formats is implemented in:
* microsoft/winget-cli/issues/5083
Be sure to add your 👍 to the issue to help raise the priority and avoid posting "Me too!" messages to respect those who have subscribed to the issue.
Template: msftbot/blockingIssue/nonExeArchiveSupport
- addLabel:
label: Blocking-Issue
- addLabel:
label: Needs-Author-Feedback
- removeLabel:
label: Needs-Attention
# The policy service should trigger even when the label was added by the policy service
triggerOnOwnActions: true
- description: >-
When the label "portable-jar" is added to an issue
* Add the issue specific reply notifying the issue author of a blocking issue
* Label the issue with Blocking-Issue
if:
- payloadType: Issues
- labelAdded:
label: portable-jar
then:
- addReply:
reply: >-
Hello @${issueAuthor},
This package appears to require support for non-EXE files packaged inside an archive.
This issue is blocked until support for non-EXE formats is implemented in:
* microsoft/winget-cli/issues/5083
Be sure to add your 👍 to the issue to help raise the priority and avoid posting "Me too!" messages to respect those who have subscribed to the issue.
Template: msftbot/blockingIssue/nonExeArchiveSupport
- addLabel:
label: Blocking-Issue
# The policy service should trigger even when the label was added by the policy service
triggerOnOwnActions: true
onFailure:
onSuccess:
40 changes: 40 additions & 0 deletions .github/policies/labelAdded.scriptedApplication.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
id: labelAdded.scriptedApplication
name: GitOps.PullRequestIssueManagement
description: Handlers when "Scripted-Application" label is added
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: >-
When the label "Scripted-Application" is added to a pull request
* Add the PR specific reply notifying the issue author
* Assign to the Author
* Label with Blocking-Issue
* Label with Needs-Author-Feedback
if:
- payloadType: Pull_Request
- labelAdded:
label: Scripted-Application
then:
- addReply:
reply: >-
Hello @${issueAuthor},
This application was identified as having a script as either the executable or the installer. The policies of this repository do not allow scripts such as `.bat`, `.ps1`, `.sh`, et cetera. This package cannot be included in this repository until the publisher removes the script or moves to a compiled binary such as an exe, msi, or appx.
Template: msftbot/policy/noScripts
- assignTo:
author: True
- addLabel:
label: Blocking-Issue
- addLabel:
label: Needs-Author-Feedback
# The policy service should trigger even when the label was added by the policy service
triggerOnOwnActions: true
onFailure:
onSuccess:
42 changes: 42 additions & 0 deletions .github/policies/scheduledSearch.closeBlockingIssue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
id: scheduledSearch.closeAreaExternal
name: GitOps.PullRequestIssueManagement
description: Close stale pull requests marked with "Blocking-Issue"
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
scheduledSearches:
- description: >-
Search for PR where -
* Pull Request is Open
* Pull request has the label Blocking-Issue
* Has not had activity in the last 15 days
Then -
* Add reply notifying author
* Close the PR
frequencies:
- hourly:
hour: 24
filters:
- isPullRequest
- isOpen
- hasLabel:
label: Blocking-Issue
- noActivitySince:
days: 15
actions:
- addReply:
reply: >-
Hello @${issueAuthor},
Thank you for your contribution. This Pull Request has been identified as being blocked by a known issue. Since there has been no recent activity on this PR, it will be automatically closed. Please re-submit your PR with the necessary changes once the blocking issue is resolved. If an issue has not been linked, please tag whomever added the Blocking-Issue label for additional information.
Template: msftbot/noRecentActivity/blockingIssue
- closeIssue
onFailure:
onSuccess:
35 changes: 0 additions & 35 deletions .github/policies/scheduledSearch.closeInteractiveOnly.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/policies/scheduledSearch.markInteractiveOnly.yml

This file was deleted.

0 comments on commit 54abb12

Please sign in to comment.