Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/policies/BreakingChangeManagement.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
id:
name: GitOps.BreakingChangeManagement
description: GitOps.BreakingChangeManagement primitive
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- if:
- payloadType: Issues
- labelAdded:
label: breaking-change
then:
- addReply:
reply: >-
Refer to the [.NET SDK breaking change guidelines](https://github.com/dotnet/sdk/blob/main/documentation/project-docs/breaking-change-guidelines.md#required-process-for-all-net-sdk-breaking-changes)
description: Add breaking change doc instructions to issue
- if:
- payloadType: Pull_Request
- labelAdded:
label: breaking-change
then:
- addLabel:
label: needs-breaking-change-doc-created
- addReply:
reply: >-
Added `needs-breaking-change-doc-created` label because this PR has the `breaking-change` label.


When you commit this breaking change:


1. [ ] Create and link to this PR and the issue a matching issue in the dotnet/docs repo using the [breaking change documentation template](https://aka.ms/dotnet/docs/new-breaking-change-issue), then remove this `needs-breaking-change-doc-created` label.

2. [ ] Ask a committer to mail the `.NET SDK Breaking Change Notification` email list.


You can refer to the [.NET SDK breaking change guidelines](https://github.com/dotnet/sdk/blob/main/documentation/project-docs/breaking-change-guidelines.md)
description: Add breaking change instructions to PR.
onFailure:
onSuccess:
36 changes: 36 additions & 0 deletions .github/policies/LabelManagement.IssueClosed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
id:
name: LabelManagement.IssueClosed
description: Handlers when an issue gets closed
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: Remove labels when an issue is closed
if:
- payloadType: Issues
- isAction:
action: Closed
then:
- removeLabel:
label: 'Needs: Triage :mag:'
- removeLabel:
label: 'Needs: Attention :wave:'
- removeLabel:
label: 'Needs: Author Feedback'
- removeLabel:
label: Help-Wanted
- description: Remove labels when a pull request is closed
if:
- payloadType: Pull_Request
- isAction:
action: Closed
then:
- removeLabel:
label: 'Needs: Attention :wave:'
- removeLabel:
label: 'Needs: Author Feedback'
onFailure:
onSuccess:
27 changes: 27 additions & 0 deletions .github/policies/LabelManagement.IssueOpened.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
id:
name: LabelManagement.IssueOpened
description: Handlers when an issue is first opened
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: Add needs triage to new issues
if:
- payloadType: Issues
- isAction:
action: Opened
- and:
- not:
activitySenderHasPermission:
permission: Admin
- not:
activitySenderHasPermission:
permission: Write
then:
- addLabel:
label: 'Needs: Triage :mag:'
onFailure:
onSuccess:
144 changes: 144 additions & 0 deletions .github/policies/LabelManagement.IssueUpdated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
id:
name: LabelManagement.IssueUpdated
description: Handlers when an issue is updated but not closed
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: >-
Remove "State: No Recent Activity" when a pull request or issue is updated
if:
- or:
- payloadType: Pull_Request
- payloadType: Pull_Request_Review
- payloadType: Pull_Request_Review_Comment
- payloadType: Issue_Comment
- payloadType: Issues
- not:
isAction:
action: Closed
- hasLabel:
label: "State: No Recent Activity"
then:
- removeLabel:
label: "State: No Recent Activity"
# The policy service should not trigger itself here, or else the label would be removed immediately after being added
triggerOnOwnActions: False
- description: Clean email replies on every comment
if:
- payloadType: Issue_Comment
then:
- cleanEmailReply
- description: Remove "Help-Wanted" label when an issue goes into PR
if:
- payloadType: Issues
- labelAdded:
label: In-PR
- hasLabel:
label: Help-Wanted
then:
- removeLabel:
label: Help-Wanted
- description: >-
If an author responds to an issue which needs author feedback
* Remove the "Needs: Author Feedback" Label
* Add the "Needs: Attention :wave:" Label
if:
- or:
- payloadType: Pull_Request_Review
- payloadType: Pull_Request_Review_Comment
- payloadType: Issue_Comment
- isActivitySender:
issueAuthor: True
- hasLabel:
label: "Needs: Author Feedback"
- not:
isAction:
action: Synchronize
then:
- removeLabel:
label: "Needs: Author Feedback"
- addLabel:
label: "Needs: Attention :wave:"
- description: >-
If team members respond to an issue which needs attention
* Remove the "Needs: Attention :wave:" Label
if:
- or:
- payloadType: Pull_Request_Review
- payloadType: Pull_Request_Review_Comment
- payloadType: Issue_Comment
- isActivitySender:
issueAuthor: True
- hasLabel:
label: "Needs: Attention :wave:"
- not:
isAction:
action: Synchronize
- or:
- activitySenderHasAssociation:
association: Member
- activitySenderHasAssociation:
association: Owner
- activitySenderHasAssociation:
association: Collaborator
then:
- removeLabel:
label: "Needs: Attention :wave:"
- description: >-
If team members respond to an issue which needs triage
* Remove the "Needs: Triage :mag:" Label
if:
- or:
- payloadType: Pull_Request_Review
- payloadType: Pull_Request_Review_Comment
- payloadType: Issue_Comment
- isActivitySender:
issueAuthor: True
- hasLabel:
label: "Needs: Triage :mag:"
- not:
isAction:
action: Synchronize
- or:
- activitySenderHasAssociation:
association: Member
- activitySenderHasAssociation:
association: Owner
- activitySenderHasAssociation:
association: Collaborator
then:
- removeLabel:
label: "Needs: Triage :mag:"
- description: >-
When changes are requested on a pull request
* Disable automerge
* Assign to the author
* Label with "Needs: Author Feedback"
if:
- payloadType: Pull_Request_Review
- isAction:
action: Submitted
- isReviewState:
reviewState: Changes_requested
then:
- disableAutoMerge
- assignTo:
author: True
- addLabel:
label: "Needs: Author Feedback"
- description: Sync labels from issues on all pull request events
if:
- payloadType: Pull_Request
then:
- labelSync:
pattern: "Area:"
- labelSync:
pattern: "Type:"
- inPrLabel:
label: In-PR
onFailure:
onSuccess:
102 changes: 102 additions & 0 deletions .github/policies/ScheduledSearch.AutoClose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
id: ScheduledSearch.AutoClose
name: GitOps.PullRequestIssueManagement
description: Housekeeping of issues that should be closed
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
scheduledSearches:
- description: >-
Search for PR where -
* Pull Request is Open
* Pull request has the label "State: No Recent Activity"
* Pull request has the label "Needs: Author Feedback"
* Has not had activity in the last 7 days

Then -
* Close the PR
frequencies:
- hourly:
hour: 6
filters:
- isPullRequest
- isOpen
- hasLabel:
label: "State: No Recent Activity"
- hasLabel:
label: "Needs: Author Feedback"
- noActivitySince:
days: 7
actions:
- closeIssue
- description: >-
Search for Issues where -
* Issue is Open
* Issue has the label "State: No Recent Activity"
* Issue has the label "Needs: Author Feedback"
* Has not had activity in the last 7 days

Then -
* Close the Issue
frequencies:
- hourly:
hour: 6
filters:
- isIssue
- isOpen
- hasLabel:
label: "State: No Recent Activity"
- hasLabel:
label: "Needs: Author Feedback"
- noActivitySince:
days: 7
actions:
- closeIssue
- description: >-
Search for Issues where -
* Issue is Open
* Issue has the label "State: Won't Fix"
* Has not had activity in the last 1 day

Then -
* Close the Issue
frequencies:
- hourly:
hour: 6
filters:
- isIssue
- isOpen
- hasLabel:
label: "State: Won't Fix"
- noActivitySince:
days: 1
actions:
- addReply:
reply: This issue has been marked as won't fix and has not had any activity for **1 day**. It will be closed for housekeeping purposes.
- closeIssue
- description: >-
Search for Issues where -
* Issue is Open
* Issue has the label "Resolution: Duplicate"
* Has not had activity in the last 1 day

Then -
* Close the Issue
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
onFailure:
onSuccess:
Loading