Skip to content

Commit

Permalink
Add resources for commenting on additional known issues and close blo…
Browse files Browse the repository at this point in the history
…cked PRs
  • Loading branch information
Trenly committed Nov 25, 2024
1 parent 7d5005f commit d1ba8d5
Show file tree
Hide file tree
Showing 4 changed files with 220 additions and 0 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:
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:
62 changes: 62 additions & 0 deletions .github/policies/scheduledSearch.closeBlockingIssue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
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 30 days
* Has a label which links the blocking issue
Then -
* Add reply notifying author
* Close the PR
frequencies:
- hourly:
hour: 24
filters:
- isPullRequest
- isOpen
- hasLabel:
label: Blocking-Issue
- noActivitySince:
days: 30
- or:
- hasLabel:
label: Hardware
- hasLabel:
label: WindowsFeatures
- hasLabel:
label: zip-binary
- hasLabel:
label: DriverInstall
- hasLabel:
label: portable-archive
- hasLabel:
label: portable-jar
- hasLabel:
label: Scripted-Application
- hasLabel:
label: Network-Blocker
- hasLabel:
label: Interactive-Only-Installer
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.
Template: msftbot/noRecentActivity/blockingIssue
- closeIssue
onFailure:
onSuccess:

0 comments on commit d1ba8d5

Please sign in to comment.