Skip to content

Commit ef5ed24

Browse files
authored
Moving things from repoman to policy (#34424)
* Create labelAdded-mapQuest.yml * Trim down repoman config * add metadata field to docs issue template * Create issueManagement-notTriaged.yml * handle needs more info * Create issueManagement-emptyIssue.yml * Update labelAdded-mapQuest.yml * Update issueManagement-notTriaged.yml * Create labelAdded-areaLabels.yml * Delete .github/workflows/issue-processing.yml * Update labelAdded-areaLabels.yml * Create pullRequestManagement-labelFiles.yml * Test * Use some other config that was previously working to check... * Restore and remove dupe pattern: * try adding qoutes * Remove reviewer request from labelFiles.yml * Add reviewer request for specific file patterns * Update reviewer request format in YAML file * Update PR management to assign guardrex * Change 'assignTo' to 'requestReview' in YAML * Remove PRMerger tool reference in metadata description
1 parent ab10dd5 commit ef5ed24

File tree

9 files changed

+250
-64
lines changed

9 files changed

+250
-64
lines changed

.github/ISSUE_TEMPLATE/customer-feedback.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,11 @@ body:
4444
required: true
4545
attributes:
4646
label: Article author
47-
47+
- type: textarea
48+
id: metadata
49+
validations:
50+
required: false
51+
attributes:
52+
label: Metadata
53+
description: >-
54+
Documentation metadata will be applied here

.github/policies/close-issues.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Close issues
2+
description: Close issues based on label
3+
resource: repository
4+
where:
5+
configuration:
6+
resourceManagementConfiguration:
7+
scheduledSearches:
8+
- frequencies:
9+
- daily:
10+
time: 12:00
11+
filters:
12+
- isIssue
13+
- isOpen
14+
- hasLabel:
15+
label: needs-more-info
16+
- noActivitySince:
17+
days: 14
18+
actions:
19+
- addReply:
20+
reply: This issue has been automatically closed due to no response from the original author. Feel free to reopen it if you have more information that can help us investigate the issue further.
21+
- closeIssue
22+
23+
eventResponderTasks:
24+
- description: Remove needs-more-info label when author comments on issue
25+
if:
26+
- payloadType: Issue_Comment
27+
- isAction:
28+
action: Created
29+
- isActivitySender:
30+
issueAuthor: True
31+
- hasLabel:
32+
label: needs-more-info
33+
- isOpen
34+
then:
35+
- removeLabel:
36+
label: needs-more-info
37+
38+
- description: Close issues labeled 'code-of-conduct'
39+
if:
40+
- payloadType: Issues
41+
- hasLabel:
42+
label: code-of-conduct
43+
then:
44+
- closeIssue
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
id: issueManagement.emptyIssue
2+
name: GitOps.EmptyIssue
3+
description: Checks for an issue created via learn that has an empty description from the template.
4+
owner:
5+
resource: repository
6+
disabled: false
7+
where:
8+
configuration:
9+
resourceManagementConfiguration:
10+
eventResponderTasks:
11+
- description: Close an issue created with the learn template that has an empty body.
12+
if:
13+
- payloadType: Issues
14+
- bodyContains:
15+
pattern: '### Description[\n\r]+\[Enter feedback here\][\n\r]+###'
16+
isRegex: true
17+
then:
18+
- addLabel: 'needs-more-info'
19+
- removeLabel: ':watch: Not Triaged'
20+
- closeIssue
21+
22+
triggerOnOwnActions: false
23+
24+
onFailure:
25+
onSuccess:
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
id: issueManagement.notTriaged
2+
name: GitOps.NotTriagedHandler
3+
description: Ensures the Not Triaged label is added or removed when appropriate
4+
owner:
5+
resource: repository
6+
disabled: false
7+
where:
8+
configuration:
9+
resourceManagementConfiguration:
10+
eventResponderTasks:
11+
- description: >-
12+
Add "not triaged" label when:
13+
* Issue is opened
14+
* Issue is reopened
15+
* 'needs-more-info' label removed
16+
if:
17+
- payloadType: Issues
18+
- or:
19+
20+
- or:
21+
- isAction:
22+
action: Opened
23+
- isAction:
24+
action: Reopened
25+
26+
- labelRemoved:
27+
label: 'needs-more-info'
28+
then:
29+
- addLabel: ':watch: Not Triaged'
30+
triggerOnOwnActions: false
31+
32+
- description: >-
33+
Remove "not triaged" label when:
34+
* Issue author closes the issue
35+
* reQUEST label is added
36+
if:
37+
- payloadType: Issues
38+
- hasLabel:
39+
label: ':watch: Not Triaged'
40+
- or:
41+
- and:
42+
- isAction:
43+
action: Closed
44+
- isActivitySender:
45+
issueAuthor: true
46+
47+
- labelAdded:
48+
label: 'reQUEST'
49+
then:
50+
- removeLabel: ':watch: Not Triaged'
51+
triggerOnOwnActions: false
52+
53+
onFailure:
54+
onSuccess:
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
id: labelAdded.areaLabels
2+
name: GitOps.AreaLabelHandler
3+
description: Handles when specific area labels are added
4+
owner:
5+
resource: repository
6+
disabled: false
7+
where:
8+
configuration:
9+
resourceManagementConfiguration:
10+
eventResponderTasks:
11+
- description: >-
12+
When the label "grpc/subsvc" is added to an issue
13+
* Add label "gRPC"
14+
if:
15+
- payloadType: Issues
16+
- labelAdded:
17+
label: 'grpc/subsv'
18+
then:
19+
- addLabel: 'gRPC'
20+
21+
- description: >-
22+
When the label "aspnetcore-signalr/subsvc" is added to an issue
23+
* Add label "SignalR"
24+
if:
25+
- payloadType: Issues
26+
- labelAdded:
27+
label: 'aspnetcore-signalr/subsvc'
28+
then:
29+
- addLabel: 'SignalR'
30+
31+
onFailure:
32+
onSuccess:
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
id: labelAdded.mapQuest
2+
name: GitOps.MapQuestHandler
3+
description: Handles when "mapQUEST" label is added
4+
owner:
5+
resource: repository
6+
disabled: false
7+
where:
8+
configuration:
9+
resourceManagementConfiguration:
10+
eventResponderTasks:
11+
- description: >-
12+
When the label "mapQUEST" is added to an issue
13+
* Remove label "mapQUEST"
14+
if:
15+
- or:
16+
- payloadType: Issues
17+
- payloadType: Pull_Request
18+
19+
- labelAdded:
20+
label: 'mapQUEST'
21+
then:
22+
- removeLabel: 'mapQUEST'
23+
triggerOnOwnActions: true
24+
onFailure:
25+
onSuccess:
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
id: pullRequestManagement.labelFiles
2+
name: GitOps.PullRequestLabelFiles
3+
description: Checks the files touched by a pull request and assigns a reviewer
4+
owner:
5+
resource: repository
6+
disabled: false
7+
where:
8+
configuration:
9+
resourceManagementConfiguration:
10+
eventResponderTasks:
11+
- description: Modify PRs that touch certain files
12+
triggerOnOwnActions: false
13+
if:
14+
- payloadType: Pull_Request
15+
- or:
16+
- isAction:
17+
action: Opened
18+
- isAction:
19+
action: Synchronize
20+
- not:
21+
targetsBranch:
22+
branch: live
23+
then:
24+
- if:
25+
- filesMatchPattern:
26+
matchAny: true
27+
pattern: '(?i).*/blazor/hybrid/.*'
28+
then:
29+
- requestReview:
30+
reviewer: guardrex
31+
- addLabel:
32+
label: 'blazor-hybrid/subsvc'
33+
- if:
34+
- or:
35+
- filesMatchPattern:
36+
matchAny: true
37+
pattern: '(?i).*/blazor/.*'
38+
- filesMatchPattern:
39+
matchAny: true
40+
pattern: '(?i).*/client-side/dotnet-interop/index.md'
41+
- filesMatchPattern:
42+
matchAny: true
43+
pattern: '(?i).*/client-side/dotnet-interop/wasm-browser-app.md'
44+
- filesMatchPattern:
45+
matchAny: true
46+
pattern: '(?i).*/mvc/views/tag-helpers/built-in/component-tag-helper.md'
47+
- filesMatchPattern:
48+
matchAny: true
49+
pattern: '(?i).*/mvc/views/tag-helpers/built-in/persist-component-state.md'
50+
then:
51+
- requestReview:
52+
reviewer: guardrex
53+
- addLabel:
54+
label: 'blazor/subsvc'
55+
onFailure:
56+
onSuccess:

.github/workflows/issue-processing.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.repoman.yml

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
revision: 5
1+
revision: 6
22
schema-version: 5
33
owner-ms-alias: adegeo
44

@@ -10,29 +10,11 @@ config:
1010
ParserRegex: "^\\* (.*): (.*)$"
1111

1212
ContentUrlRegex:
13-
- "### Page URL\n\n(.*)"
13+
- "### Page URL\n\n(.*)"
1414

1515
issues:
1616

1717
opened:
18-
# New issue opened, add Not Triaged
19-
- labels-add: [":watch: Not Triaged"]
20-
21-
# Try to detect an empty issue
22-
- check:
23-
- type: comment-body
24-
value: "### Description[\\n\\r]+\\[Enter feedback here\\][\\n\\r]+###"
25-
pass:
26-
- labels-add: ["needs-more-info"]
27-
- labels-remove: [":watch: Not Triaged"]
28-
- close
29-
30-
# default for doc comment
31-
- check:
32-
- type: metadata-exists
33-
pass:
34-
- labels-add: ["Source - Docs.ms"]
35-
- svc_subsvc_labels: true
3618

3719
# Add links to related issues if it's a doc issue
3820
- check:
@@ -42,14 +24,12 @@ issues:
4224
pass:
4325
- link-related-issues
4426

45-
labeled:
46-
47-
# Temporary label to mark issues as updated for Quest. The label is instantly removed
27+
# If it's an issue from docs feedback, add svc/subsvc and source labels.
4828
- check:
49-
- type: query
50-
value: "length(Issue.Labels[?Name == 'mapQuest']) != `0`"
29+
- type: metadata-exists
5130
pass:
52-
- labels-remove: ["mapQuest"]
31+
- labels-add: ["Source - Docs.ms"]
32+
- svc_subsvc_labels: true
5333

5434
projects_v2_item:
5535

0 commit comments

Comments
 (0)