Skip to content

Commit 91abcb9

Browse files
authored
Use policies from testfx to align (#15085)
1 parent 95bba29 commit 91abcb9

8 files changed

+452
-143
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
id:
2+
name: GitOps.BreakingChangeManagement
3+
description: GitOps.BreakingChangeManagement primitive
4+
owner:
5+
resource: repository
6+
disabled: false
7+
where:
8+
configuration:
9+
resourceManagementConfiguration:
10+
eventResponderTasks:
11+
- if:
12+
- payloadType: Issues
13+
- labelAdded:
14+
label: breaking-change
15+
then:
16+
- addReply:
17+
reply: >-
18+
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)
19+
description: Add breaking change doc instructions to issue
20+
- if:
21+
- payloadType: Pull_Request
22+
- labelAdded:
23+
label: breaking-change
24+
then:
25+
- addLabel:
26+
label: needs-breaking-change-doc-created
27+
- addReply:
28+
reply: >-
29+
Added `needs-breaking-change-doc-created` label because this PR has the `breaking-change` label.
30+
31+
32+
When you commit this breaking change:
33+
34+
35+
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.
36+
37+
2. [ ] Ask a committer to mail the `.NET SDK Breaking Change Notification` email list.
38+
39+
40+
You can refer to the [.NET SDK breaking change guidelines](https://github.com/dotnet/sdk/blob/main/documentation/project-docs/breaking-change-guidelines.md)
41+
description: Add breaking change instructions to PR.
42+
onFailure:
43+
onSuccess:
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
id:
2+
name: LabelManagement.IssueClosed
3+
description: Handlers when an issue gets closed
4+
owner:
5+
resource: repository
6+
disabled: false
7+
where:
8+
configuration:
9+
resourceManagementConfiguration:
10+
eventResponderTasks:
11+
- description: Remove labels when an issue is closed
12+
if:
13+
- payloadType: Issues
14+
- isAction:
15+
action: Closed
16+
then:
17+
- removeLabel:
18+
label: 'Needs: Triage :mag:'
19+
- removeLabel:
20+
label: 'Needs: Attention :wave:'
21+
- removeLabel:
22+
label: 'Needs: Author Feedback'
23+
- removeLabel:
24+
label: Help-Wanted
25+
- description: Remove labels when a pull request is closed
26+
if:
27+
- payloadType: Pull_Request
28+
- isAction:
29+
action: Closed
30+
then:
31+
- removeLabel:
32+
label: 'Needs: Attention :wave:'
33+
- removeLabel:
34+
label: 'Needs: Author Feedback'
35+
onFailure:
36+
onSuccess:
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
id:
2+
name: LabelManagement.IssueOpened
3+
description: Handlers when an issue is first opened
4+
owner:
5+
resource: repository
6+
disabled: false
7+
where:
8+
configuration:
9+
resourceManagementConfiguration:
10+
eventResponderTasks:
11+
- description: Add needs triage to new issues
12+
if:
13+
- payloadType: Issues
14+
- isAction:
15+
action: Opened
16+
- and:
17+
- not:
18+
activitySenderHasPermission:
19+
permission: Admin
20+
- not:
21+
activitySenderHasPermission:
22+
permission: Write
23+
then:
24+
- addLabel:
25+
label: 'Needs: Triage :mag:'
26+
onFailure:
27+
onSuccess:
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
id:
2+
name: LabelManagement.IssueUpdated
3+
description: Handlers when an issue is updated but not closed
4+
owner:
5+
resource: repository
6+
disabled: false
7+
where:
8+
configuration:
9+
resourceManagementConfiguration:
10+
eventResponderTasks:
11+
- description: >-
12+
Remove "State: No Recent Activity" when a pull request or issue is updated
13+
if:
14+
- or:
15+
- payloadType: Pull_Request
16+
- payloadType: Pull_Request_Review
17+
- payloadType: Pull_Request_Review_Comment
18+
- payloadType: Issue_Comment
19+
- payloadType: Issues
20+
- not:
21+
isAction:
22+
action: Closed
23+
- hasLabel:
24+
label: "State: No Recent Activity"
25+
then:
26+
- removeLabel:
27+
label: "State: No Recent Activity"
28+
# The policy service should not trigger itself here, or else the label would be removed immediately after being added
29+
triggerOnOwnActions: False
30+
- description: Clean email replies on every comment
31+
if:
32+
- payloadType: Issue_Comment
33+
then:
34+
- cleanEmailReply
35+
- description: Remove "Help-Wanted" label when an issue goes into PR
36+
if:
37+
- payloadType: Issues
38+
- labelAdded:
39+
label: In-PR
40+
- hasLabel:
41+
label: Help-Wanted
42+
then:
43+
- removeLabel:
44+
label: Help-Wanted
45+
- description: >-
46+
If an author responds to an issue which needs author feedback
47+
* Remove the "Needs: Author Feedback" Label
48+
* Add the "Needs: Attention :wave:" Label
49+
if:
50+
- or:
51+
- payloadType: Pull_Request_Review
52+
- payloadType: Pull_Request_Review_Comment
53+
- payloadType: Issue_Comment
54+
- isActivitySender:
55+
issueAuthor: True
56+
- hasLabel:
57+
label: "Needs: Author Feedback"
58+
- not:
59+
isAction:
60+
action: Synchronize
61+
then:
62+
- removeLabel:
63+
label: "Needs: Author Feedback"
64+
- addLabel:
65+
label: "Needs: Attention :wave:"
66+
- description: >-
67+
If team members respond to an issue which needs attention
68+
* Remove the "Needs: Attention :wave:" Label
69+
if:
70+
- or:
71+
- payloadType: Pull_Request_Review
72+
- payloadType: Pull_Request_Review_Comment
73+
- payloadType: Issue_Comment
74+
- isActivitySender:
75+
issueAuthor: True
76+
- hasLabel:
77+
label: "Needs: Attention :wave:"
78+
- not:
79+
isAction:
80+
action: Synchronize
81+
- or:
82+
- activitySenderHasAssociation:
83+
association: Member
84+
- activitySenderHasAssociation:
85+
association: Owner
86+
- activitySenderHasAssociation:
87+
association: Collaborator
88+
then:
89+
- removeLabel:
90+
label: "Needs: Attention :wave:"
91+
- description: >-
92+
If team members respond to an issue which needs triage
93+
* Remove the "Needs: Triage :mag:" Label
94+
if:
95+
- or:
96+
- payloadType: Pull_Request_Review
97+
- payloadType: Pull_Request_Review_Comment
98+
- payloadType: Issue_Comment
99+
- isActivitySender:
100+
issueAuthor: True
101+
- hasLabel:
102+
label: "Needs: Triage :mag:"
103+
- not:
104+
isAction:
105+
action: Synchronize
106+
- or:
107+
- activitySenderHasAssociation:
108+
association: Member
109+
- activitySenderHasAssociation:
110+
association: Owner
111+
- activitySenderHasAssociation:
112+
association: Collaborator
113+
then:
114+
- removeLabel:
115+
label: "Needs: Triage :mag:"
116+
- description: >-
117+
When changes are requested on a pull request
118+
* Disable automerge
119+
* Assign to the author
120+
* Label with "Needs: Author Feedback"
121+
if:
122+
- payloadType: Pull_Request_Review
123+
- isAction:
124+
action: Submitted
125+
- isReviewState:
126+
reviewState: Changes_requested
127+
then:
128+
- disableAutoMerge
129+
- assignTo:
130+
author: True
131+
- addLabel:
132+
label: "Needs: Author Feedback"
133+
- description: Sync labels from issues on all pull request events
134+
if:
135+
- payloadType: Pull_Request
136+
then:
137+
- labelSync:
138+
pattern: "Area:"
139+
- labelSync:
140+
pattern: "Type:"
141+
- inPrLabel:
142+
label: In-PR
143+
onFailure:
144+
onSuccess:
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
id: ScheduledSearch.AutoClose
2+
name: GitOps.PullRequestIssueManagement
3+
description: Housekeeping of issues that should be closed
4+
owner:
5+
resource: repository
6+
disabled: false
7+
where:
8+
configuration:
9+
resourceManagementConfiguration:
10+
scheduledSearches:
11+
- description: >-
12+
Search for PR where -
13+
* Pull Request is Open
14+
* Pull request has the label "State: No Recent Activity"
15+
* Pull request has the label "Needs: Author Feedback"
16+
* Has not had activity in the last 7 days
17+
18+
Then -
19+
* Close the PR
20+
frequencies:
21+
- hourly:
22+
hour: 6
23+
filters:
24+
- isPullRequest
25+
- isOpen
26+
- hasLabel:
27+
label: "State: No Recent Activity"
28+
- hasLabel:
29+
label: "Needs: Author Feedback"
30+
- noActivitySince:
31+
days: 7
32+
actions:
33+
- closeIssue
34+
- description: >-
35+
Search for Issues where -
36+
* Issue is Open
37+
* Issue has the label "State: No Recent Activity"
38+
* Issue has the label "Needs: Author Feedback"
39+
* Has not had activity in the last 7 days
40+
41+
Then -
42+
* Close the Issue
43+
frequencies:
44+
- hourly:
45+
hour: 6
46+
filters:
47+
- isIssue
48+
- isOpen
49+
- hasLabel:
50+
label: "State: No Recent Activity"
51+
- hasLabel:
52+
label: "Needs: Author Feedback"
53+
- noActivitySince:
54+
days: 7
55+
actions:
56+
- closeIssue
57+
- description: >-
58+
Search for Issues where -
59+
* Issue is Open
60+
* Issue has the label "State: Won't Fix"
61+
* Has not had activity in the last 1 day
62+
63+
Then -
64+
* Close the Issue
65+
frequencies:
66+
- hourly:
67+
hour: 6
68+
filters:
69+
- isIssue
70+
- isOpen
71+
- hasLabel:
72+
label: "State: Won't Fix"
73+
- noActivitySince:
74+
days: 1
75+
actions:
76+
- addReply:
77+
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.
78+
- closeIssue
79+
- description: >-
80+
Search for Issues where -
81+
* Issue is Open
82+
* Issue has the label "Resolution: Duplicate"
83+
* Has not had activity in the last 1 day
84+
85+
Then -
86+
* Close the Issue
87+
frequencies:
88+
- hourly:
89+
hour: 6
90+
filters:
91+
- isIssue
92+
- isOpen
93+
- hasLabel:
94+
label: "Resolution: Duplicate"
95+
- noActivitySince:
96+
days: 1
97+
actions:
98+
- addReply:
99+
reply: This issue has been marked as duplicate and has not had any activity for **1 day**. It will be closed for housekeeping purposes.
100+
- closeIssue
101+
onFailure:
102+
onSuccess:

0 commit comments

Comments
 (0)