diff --git a/.github/policies/labelAdded.noRecentActivity.yml b/.github/policies/labelAdded.noRecentActivity.yml
new file mode 100644
index 00000000..ef2d18d9
--- /dev/null
+++ b/.github/policies/labelAdded.noRecentActivity.yml
@@ -0,0 +1,38 @@
+id: labelAdded.noRecentActivity
+name: GitOps.PullRequestIssueManagement
+description: Handlers when "No-Recent-Activity" label is added
+owner:
+resource: repository
+disabled: false
+where:
+configuration:
+ resourceManagementConfiguration:
+ eventResponderTasks:
+ - description: >-
+ When the label "No-Recent-Activity" is added to an issue
+ * Add a reply notifying the issue author of pending closure
+ if:
+ - payloadType: Issues
+ - labelAdded:
+ label: No-Recent-Activity
+ then:
+ - addReply:
+ reply: >-
+ This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **7 days**. It will be closed if no further activity occurs **within 7 days of this comment**.
+ # The policy service should trigger even when the label was added by the policy service
+ triggerOnOwnActions: true
+ - description: >-
+ When the label "No-Recent-Activity" is added to a pull request
+ * Add a reply notifying the PR author of pending closure
+ if:
+ - payloadType: Pull_Request
+ - labelAdded:
+ label: No-Recent-Activity
+ then:
+ - addReply:
+ reply: >-
+ This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **7 days**. It will be closed if no further activity occurs **within 7 days of this comment**.
+ # The policy service should trigger even when the label was added by the policy service
+ triggerOnOwnActions: true
+onFailure:
+onSuccess:
diff --git a/.github/policies/labelManagement.issueClosed.yml b/.github/policies/labelManagement.issueClosed.yml
new file mode 100644
index 00000000..6c6b7857
--- /dev/null
+++ b/.github/policies/labelManagement.issueClosed.yml
@@ -0,0 +1,28 @@
+id: labelManagement.issueClosed
+name: GitOps.PullRequestIssueManagement
+description: Handlers when an issue or pull request gets closed
+owner:
+resource: repository
+disabled: false
+where:
+configuration:
+ resourceManagementConfiguration:
+ eventResponderTasks:
+ - description: Remove labels when an issue or pull request is closed
+ if:
+ - or:
+ - payloadType: Issues
+ - payloadType: Pull_Request
+ - isAction:
+ action: Closed
+ then:
+ - removeLabel:
+ label: Needs-Triage
+ - removeLabel:
+ label: Needs-Attention
+ - removeLabel:
+ label: Needs-Author-Feedback
+ - removeLabel:
+ label: Help-Wanted
+onFailure:
+onSuccess:
diff --git a/.github/policies/labelManagement.issueOpened.yml b/.github/policies/labelManagement.issueOpened.yml
new file mode 100644
index 00000000..28e8aa11
--- /dev/null
+++ b/.github/policies/labelManagement.issueOpened.yml
@@ -0,0 +1,50 @@
+id: labelManagement.issueOpened
+name: GitOps.PullRequestIssueManagement
+description: Handlers for 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
+ then:
+ - addLabel:
+ label: Needs-Triage
+ - description: Add CodeFlow link to new PRs
+ if:
+ - payloadType: Pull_Request
+ - isAction:
+ action: Opened
+ then:
+ - addCodeFlowLink
+ - description: >-
+ Close issues with empty body on open or reopen
+ * Close the issue
+ * Add Needs-Author-Feedback label
+ * Add a reply notifying the author
+ if:
+ - payloadType: Issues
+ - or:
+ - isAction:
+ action: Opened
+ - isAction:
+ action: Reopened
+ - or:
+ - not:
+ bodyContains:
+ pattern: .+
+ isRegex: True
+ then:
+ - closeIssue
+ - addLabel:
+ label: Needs-Author-Feedback
+ - addReply:
+ reply: "Hi! Thanks for attempting to open an issue. Unfortunately, you didn't write anything in the body which makes it impossible to understand your concern. You are welcome to fix up the issue and try again by opening another issue with the body filled out. "
+onFailure:
+onSuccess:
diff --git a/.github/policies/labelManagement.issueUpdated.yml b/.github/policies/labelManagement.issueUpdated.yml
new file mode 100644
index 00000000..be306278
--- /dev/null
+++ b/.github/policies/labelManagement.issueUpdated.yml
@@ -0,0 +1,100 @@
+id: labelManagement.issueUpdated
+name: GitOps.PullRequestIssueManagement
+description: >-
+ Handlers for when an issue is updated and not closed.
+ This primarily includes handlers for comments, reviews, and re-runs.
+owner:
+resource: repository
+disabled: false
+where:
+configuration:
+ resourceManagementConfiguration:
+ eventResponderTasks:
+ - description: Remove "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: No-Recent-Activity
+ then:
+ - removeLabel:
+ label: 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:
+ - or:
+ - payloadType: Issue_Comment
+ - payloadType: Pull_Request_Review_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 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
+ - description: >-
+ When changes are requested on a pull request
+ * Label with Needs-Author-Feedback
+ if:
+ - payloadType: Pull_Request_Review
+ - isAction:
+ action: Submitted
+ - isReviewState:
+ reviewState: Changes_requested
+ then:
+ - addLabel:
+ label: Needs-Author-Feedback
+ - description: Sync labels from issues on all pull request events
+ if:
+ - payloadType: Pull_Request
+ then:
+ - labelSync:
+ pattern: Issue-
+ - labelSync:
+ pattern: Area-
+ - labelSync:
+ pattern: Priority-
+ - labelSync:
+ pattern: Product-
+ - labelSync:
+ pattern: Severity-
+ - labelSync:
+ pattern: Impact-
+ - inPrLabel:
+ label: In-PR
+onFailure:
+onSuccess:
diff --git a/.github/policies/moderatorTriggers.yml b/.github/policies/moderatorTriggers.yml
new file mode 100644
index 00000000..93d8eb9f
--- /dev/null
+++ b/.github/policies/moderatorTriggers.yml
@@ -0,0 +1,60 @@
+id: moderatorTriggers
+name: GitOps.PullRequestIssueManagement
+description: Handlers for moderator comment triggers
+owner:
+resource: repository
+disabled: false
+where:
+configuration:
+ resourceManagementConfiguration:
+ eventResponderTasks:
+ - description: >-
+ When a moderator comments with specific trigger patterns
+ if:
+ - or:
+ - payloadType: Issue_Comment
+ - payloadType: Pull_Request_Review_Comment
+ - or:
+ - activitySenderHasPermission:
+ permission: Admin
+ - activitySenderHasPermission:
+ permission: Write
+ then:
+ # Duplicate of #
+ - if:
+ - commentContains:
+ pattern: '(?in)Duplicate\s+of\s+\#?\s*\d+'
+ isRegex: True
+ then:
+ - addReply:
+ reply: >-
+ Hi! We've identified this issue as a duplicate of another one that already
+ exists on this Issue Tracker. This specific instance is being closed in favor
+ of tracking the concern over on the referenced thread. Be sure to add your
+ 👍 to that issue. Thanks for your report!
+ - closeIssue
+ - removeLabel:
+ label: Needs-Triage
+ - addLabel:
+ label: Resolution-Duplicate
+ - removeLabel:
+ label: Needs-Author-Feedback
+ # /feedback
+ - if:
+ - commentContains:
+ pattern: '\/feedback'
+ isRegex: True
+ then:
+ - addReply:
+ reply: >-
+ Hi there!
+
+
+ Can you please send us feedback with the Feedback Hub with this issue and paste the link here so we can more easily find your crash information on the back end?
+
+
+ Thanks!
+ - addLabel:
+ label: Needs-Author-Feedback
+onFailure:
+onSuccess:
diff --git a/.github/policies/resourceManagement.yml b/.github/policies/resourceManagement.yml
deleted file mode 100644
index 6ff4b1c9..00000000
--- a/.github/policies/resourceManagement.yml
+++ /dev/null
@@ -1,331 +0,0 @@
-id:
-name: GitOps.PullRequestIssueManagement
-description: GitOps.PullRequestIssueManagement primitive
-owner:
-resource: repository
-disabled: false
-where:
-configuration:
- resourceManagementConfiguration:
- scheduledSearches:
- - description:
- frequencies:
- - hourly:
- hour: 6
- filters:
- - isIssue
- - isOpen
- - hasLabel:
- label: Needs-Author-Feedback
- - hasLabel:
- label: No-Recent-Activity
- - noActivitySince:
- days: 7
- - isNotLabeledWith:
- label: Issue-Feature
- - isNotLabeledWith:
- label: Issue-Bug
- actions:
- - closeIssue
- - description:
- frequencies:
- - hourly:
- hour: 3
- filters:
- - isIssue
- - isOpen
- - hasLabel:
- label: Needs-Author-Feedback
- - noActivitySince:
- days: 7
- - isNotLabeledWith:
- label: No-Recent-Activity
- actions:
- - addLabel:
- label: No-Recent-Activity
- - addReply:
- reply: This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **7 days**. It will be closed if no further activity occurs **within 7 days of this comment**.
- - description:
- frequencies:
- - hourly:
- hour: 3
- 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.
- - removeLabel:
- label: Needs-Triage
- - closeIssue
- - description:
- frequencies:
- - hourly:
- hour: 3
- filters:
- - isPullRequest
- - isOpen
- - hasLabel:
- label: Needs-Author-Feedback
- - hasLabel:
- label: No-Recent-Activity
- - noActivitySince:
- days: 7
- actions:
- - closeIssue
- - description:
- frequencies:
- - hourly:
- hour: 6
- filters:
- - isPullRequest
- - isOpen
- - hasLabel:
- label: Needs-Author-Feedback
- - noActivitySince:
- days: 7
- - isNotLabeledWith:
- label: No-Recent-Activity
- actions:
- - addLabel:
- label: No-Recent-Activity
- - addReply:
- reply: This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **7 days**. It will be closed if no further activity occurs **within 7 days of this comment**.
- eventResponderTasks:
- - if:
- - payloadType: Issues
- - or:
- - and:
- - isAction:
- action: Opened
- then:
- - addLabel:
- label: Needs-Triage
- description:
- - if:
- - payloadType: Issue_Comment
- - isAction:
- action: Created
- - isActivitySender:
- issueAuthor: True
- - hasLabel:
- label: Needs-Author-Feedback
- then:
- - addLabel:
- label: Needs-Attention
- - removeLabel:
- label: Needs-Author-Feedback
- - removeLabel:
- label: No-Recent-Activity
- description:
- - if:
- - payloadType: Issues
- - not:
- isAction:
- action: Closed
- - hasLabel:
- label: No-Recent-Activity
- then:
- - removeLabel:
- label: No-Recent-Activity
- description:
- - if:
- - payloadType: Issue_Comment
- - hasLabel:
- label: No-Recent-Activity
- then:
- - removeLabel:
- label: No-Recent-Activity
- description:
- - if:
- - payloadType: Pull_Request
- - isAction:
- action: Opened
- then:
- - addCodeFlowLink
- description:
- - if:
- - payloadType: Pull_Request_Review
- - isAction:
- action: Submitted
- - isReviewState:
- reviewState: Changes_requested
- then:
- - addLabel:
- label: Needs-Author-Feedback
- description:
- - if:
- - payloadType: Pull_Request
- - isActivitySender:
- issueAuthor: True
- - not:
- isAction:
- action: Closed
- - hasLabel:
- label: Needs-Author-Feedback
- then:
- - removeLabel:
- label: Needs-Author-Feedback
- description:
- - if:
- - payloadType: Issue_Comment
- - isActivitySender:
- issueAuthor: True
- - hasLabel:
- label: Needs-Author-Feedback
- then:
- - removeLabel:
- label: Needs-Author-Feedback
- description:
- - if:
- - payloadType: Pull_Request_Review
- - isActivitySender:
- issueAuthor: True
- - hasLabel:
- label: Needs-Author-Feedback
- then:
- - removeLabel:
- label: Needs-Author-Feedback
- description:
- - if:
- - payloadType: Pull_Request
- - not:
- isAction:
- action: Closed
- - hasLabel:
- label: No-Recent-Activity
- then:
- - removeLabel:
- label: No-Recent-Activity
- description:
- - if:
- - payloadType: Issue_Comment
- - hasLabel:
- label: No-Recent-Activity
- then:
- - removeLabel:
- label: No-Recent-Activity
- description:
- - if:
- - payloadType: Pull_Request_Review
- - hasLabel:
- label: No-Recent-Activity
- then:
- - removeLabel:
- label: No-Recent-Activity
- description:
- - if:
- - payloadType: Pull_Request
- - hasLabel:
- label: AutoMerge
- then:
- - enableAutoMerge:
- mergeMethod: Squash
- description:
- - if:
- - payloadType: Pull_Request
- - labelRemoved:
- label: AutoMerge
- then:
- - disableAutoMerge
- description:
- - if:
- - payloadType: Pull_Request
- then:
- - inPrLabel:
- label: In-PR
- description:
- - if:
- - payloadType: Issues
- - or:
- - isAction:
- action: Opened
- - isAction:
- action: Reopened
- - or:
- - not:
- bodyContains:
- pattern: .+
- isRegex: True
- then:
- - closeIssue
- - addLabel:
- label: Needs-Author-Feedback
- - addReply:
- reply: "Hi! Thanks for attempting to open an issue. Unfortunately, you didn't write anything in the body which makes it impossible to understand your concern. You are welcome to fix up the issue and try again by opening another issue with the body filled out. "
- description:
- - if:
- - payloadType: Issues
- - hasLabel:
- label: In-PR
- - hasLabel:
- label: Help-Wanted
- - isLabeled
- then:
- - removeLabel:
- label: Help-Wanted
- description:
- - if:
- - payloadType: Issue_Comment
- - commentContains:
- pattern: Duplicate\s+of\s+\#?\s*\d+
- isRegex: True
- - or:
- - activitySenderHasPermission:
- permission: Admin
- - activitySenderHasPermission:
- permission: Write
- then:
- - addReply:
- reply: "Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Be sure to add your \U0001F44D to that issue. Thanks for your report!"
- - closeIssue
- - removeLabel:
- label: Needs-Triage
- - addLabel:
- label: Resolution-Duplicate
- - removeLabel:
- label: Needs-Author-Feedback
- description:
- - if:
- - payloadType: Issue_Comment
- - commentContains:
- pattern: '\/feedback'
- isRegex: True
- - or:
- - activitySenderHasPermission:
- permission: Admin
- - activitySenderHasPermission:
- permission: Write
- then:
- - addReply:
- reply: Hi there!
Can you please send us feedback with the Feedback Hub with this issue and paste the link here so we can more easily find your crash information on the back end?
Thanks!
 
- - addLabel:
- label: Needs-Author-Feedback
- description:
- - if:
- - payloadType: Issue_Comment
- then:
- - cleanEmailReply
- description:
- - if:
- - payloadType: Pull_Request
- then:
- - labelSync:
- pattern: Issue-
- - labelSync:
- pattern: Area-
- - labelSync:
- pattern: Priority-
- - labelSync:
- pattern: Product-
- - labelSync:
- pattern: Severity-
- - labelSync:
- pattern: Impact-
- description:
-onFailure:
-onSuccess:
diff --git a/.github/policies/scheduledSearch.closeNoRecentActivity.yml b/.github/policies/scheduledSearch.closeNoRecentActivity.yml
new file mode 100644
index 00000000..8edd4ad0
--- /dev/null
+++ b/.github/policies/scheduledSearch.closeNoRecentActivity.yml
@@ -0,0 +1,88 @@
+id: scheduledSearch.closeNoRecentActivity
+name: GitOps.PullRequestIssueManagement
+description: Closes issues and pull requests that are inactive
+owner:
+resource: repository
+disabled: false
+where:
+configuration:
+ resourceManagementConfiguration:
+ scheduledSearches:
+ - description: >-
+ Search for Issues where -
+ * Issue is Open
+ * Issue has the label Needs-Author-Feedback
+ * Issue has the label No-Recent-Activity
+ * Issue does not have the label Blocking-Issue
+ * Issue does not have the label Issue-Feature
+ * Has not had activity in the last 7 days
+
+ Then -
+ * Close the Issue
+ frequencies:
+ - hourly:
+ hour: 6
+ filters:
+ - isIssue
+ - isOpen
+ - hasLabel:
+ label: Needs-Author-Feedback
+ - hasLabel:
+ label: No-Recent-Activity
+ - noActivitySince:
+ days: 7
+ - isNotLabeledWith:
+ label: Blocking-Issue
+ - isNotLabeledWith:
+ label: Issue-Feature
+ actions:
+ - closeIssue
+ - description: >-
+ Search for PRs where -
+ * Pull Request is Open
+ * Pull Request has the label Needs-Author-Feedback
+ * Pull Request has the label No-Recent-Activity
+ * Has not had activity in the last 7 days
+
+ Then -
+ * Close the Pull Request
+ frequencies:
+ - hourly:
+ hour: 3
+ filters:
+ - isPullRequest
+ - isOpen
+ - hasLabel:
+ label: Needs-Author-Feedback
+ - hasLabel:
+ label: No-Recent-Activity
+ - noActivitySince:
+ days: 7
+ actions:
+ - 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: 3
+ 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.
+ - removeLabel:
+ label: Needs-Triage
+ - closeIssue
+onFailure:
+onSuccess:
diff --git a/.github/policies/scheduledSearch.markNoRecentActivity.yml b/.github/policies/scheduledSearch.markNoRecentActivity.yml
new file mode 100644
index 00000000..04e43237
--- /dev/null
+++ b/.github/policies/scheduledSearch.markNoRecentActivity.yml
@@ -0,0 +1,66 @@
+id: scheduledSearch.markNoRecentActivity
+name: GitOps.PullRequestIssueManagement
+description: Marks issues and pull requests that are inactive
+owner:
+resource: repository
+disabled: false
+where:
+configuration:
+ resourceManagementConfiguration:
+ scheduledSearches:
+ - description: >-
+ Search for Issues where -
+ * Issue is Open
+ * Issue has the label Needs-Author-Feedback
+ * Issue does not have the label No-Recent-Activity
+ * Issue does not have the label Blocking-Issue
+ * Issue does not have the label Issue-Feature
+ * Has not had activity in the last 7 days
+
+ Then -
+ * Mark the Issue with No-Recent-Activity
+ frequencies:
+ - hourly:
+ hour: 6
+ filters:
+ - isIssue
+ - isOpen
+ - hasLabel:
+ label: Needs-Author-Feedback
+ - noActivitySince:
+ days: 7
+ - isNotLabeledWith:
+ label: No-Recent-Activity
+ - isNotLabeledWith:
+ label: Blocking-Issue
+ - isNotLabeledWith:
+ label: Issue-Feature
+ actions:
+ - addLabel:
+ label: No-Recent-Activity
+ - description: >-
+ Search for PRs where -
+ * Pull Request is Open
+ * Pull Request has the label Needs-Author-Feedback
+ * Pull Request does not have the label No-Recent-Activity
+ * Has not had activity in the last 7 days
+
+ Then -
+ * Mark the Pull Request with No-Recent-Activity
+ frequencies:
+ - hourly:
+ hour: 6
+ filters:
+ - isPullRequest
+ - isOpen
+ - hasLabel:
+ label: Needs-Author-Feedback
+ - noActivitySince:
+ days: 7
+ - isNotLabeledWith:
+ label: No-Recent-Activity
+ actions:
+ - addLabel:
+ label: No-Recent-Activity
+onFailure:
+onSuccess: