diff --git a/.github/fabricbot.json b/.github/fabricbot.json deleted file mode 100644 index 996f01d760..0000000000 --- a/.github/fabricbot.json +++ /dev/null @@ -1,598 +0,0 @@ -{ - "version": "1.0", - "tasks": [ - { - "taskType": "trigger", - "capabilityId": "IssueResponder", - "subCapability": "IssuesOnlyResponder", - "version": "1.0", - "config": { - "taskName": "Add needs triage label to new issues", - "conditions": { - "operator": "and", - "operands": [ - { - "name": "isAction", - "parameters": { - "action": "opened" - } - }, - { - "operator": "not", - "operands": [ - { - "name": "isPartOfProject", - "parameters": {} - } - ] - }, - { - "operator": "not", - "operands": [ - { - "name": "isAssignedToSomeone", - "parameters": {} - } - ] - } - ] - }, - "actions": [ - { - "name": "addLabel", - "parameters": { - "label": "needs-triage" - } - } - ], - "eventType": "issue", - "eventNames": [ - "issues", - "project_card" - ] - } - }, - { - "taskType": "trigger", - "capabilityId": "IssueResponder", - "subCapability": "IssueCommentResponder", - "version": "1.0", - "config": { - "taskName": "Replace needs author feedback label with needs attention label when the author comments on an issue", - "conditions": { - "operator": "and", - "operands": [ - { - "name": "isAction", - "parameters": { - "action": "created" - } - }, - { - "name": "isActivitySender", - "parameters": { - "user": { - "type": "author" - } - } - }, - { - "name": "hasLabel", - "parameters": { - "label": "needs-author-feedback" - } - }, - { - "name": "isOpen", - "parameters": {} - } - ] - }, - "actions": [ - { - "name": "addLabel", - "parameters": { - "label": "needs-attention" - } - }, - { - "name": "removeLabel", - "parameters": { - "label": "needs-author-feedback" - } - } - ], - "eventType": "issue", - "eventNames": [ - "issue_comment" - ] - } - }, - { - "taskType": "trigger", - "capabilityId": "IssueResponder", - "subCapability": "IssuesOnlyResponder", - "version": "1.0", - "config": { - "taskName": "Remove no recent activity label from issues", - "conditions": { - "operator": "and", - "operands": [ - { - "operator": "not", - "operands": [ - { - "name": "isAction", - "parameters": { - "action": "closed" - } - } - ] - }, - { - "name": "hasLabel", - "parameters": { - "label": "status-no-recent-activity" - } - } - ] - }, - "actions": [ - { - "name": "removeLabel", - "parameters": { - "label": "status-no-recent-activity" - } - } - ], - "eventType": "issue", - "eventNames": [ - "issues", - "project_card" - ] - } - }, - { - "taskType": "trigger", - "capabilityId": "IssueResponder", - "subCapability": "IssueCommentResponder", - "version": "1.0", - "config": { - "taskName": "Remove no recent activity label when an issue is commented on", - "conditions": { - "operator": "and", - "operands": [ - { - "name": "hasLabel", - "parameters": { - "label": "status-no-recent-activity" - } - } - ] - }, - "actions": [ - { - "name": "removeLabel", - "parameters": { - "label": "status-no-recent-activity" - } - } - ], - "eventType": "issue", - "eventNames": [ - "issue_comment" - ] - } - }, - { - "taskType": "scheduled", - "capabilityId": "ScheduledSearch", - "subCapability": "ScheduledSearch", - "version": "1.1", - "config": { - "taskName": "Add no recent activity label to issues", - "frequency": [ - { - "weekDay": 0, - "hours": [ - 2, - 8, - 14, - 20 - ] - }, - { - "weekDay": 1, - "hours": [ - 2, - 8, - 14, - 20 - ] - }, - { - "weekDay": 2, - "hours": [ - 2, - 8, - 14, - 20 - ] - }, - { - "weekDay": 3, - "hours": [ - 2, - 8, - 14, - 20 - ] - }, - { - "weekDay": 4, - "hours": [ - 2, - 8, - 14, - 20 - ] - }, - { - "weekDay": 5, - "hours": [ - 2, - 8, - 14, - 20 - ] - }, - { - "weekDay": 6, - "hours": [ - 2, - 8, - 14, - 20 - ] - } - ], - "searchTerms": [ - { - "name": "isIssue", - "parameters": {} - }, - { - "name": "isOpen", - "parameters": {} - }, - { - "name": "hasLabel", - "parameters": { - "label": "needs-author-feedback" - } - }, - { - "name": "noActivitySince", - "parameters": { - "days": 10 - } - }, - { - "name": "noLabel", - "parameters": { - "label": "status-no-recent-activity" - } - } - ], - "actions": [ - { - "name": "addLabel", - "parameters": { - "label": "status-no-recent-activity" - } - }, - { - "name": "addReply", - "parameters": { - "comment": "This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **10 days**." - } - } - ] - } - }, - { - "taskType": "scheduled", - "capabilityId": "ScheduledSearch", - "subCapability": "ScheduledSearch", - "version": "1.1", - "config": { - "taskName": "Close duplicate issues", - "frequency": [ - { - "weekDay": 0, - "hours": [ - 3, - 9, - 15, - 21 - ] - }, - { - "weekDay": 1, - "hours": [ - 3, - 9, - 15, - 21 - ] - }, - { - "weekDay": 2, - "hours": [ - 3, - 9, - 15, - 21 - ] - }, - { - "weekDay": 3, - "hours": [ - 3, - 9, - 15, - 21 - ] - }, - { - "weekDay": 4, - "hours": [ - 3, - 9, - 15, - 21 - ] - }, - { - "weekDay": 5, - "hours": [ - 3, - 9, - 15, - 21 - ] - }, - { - "weekDay": 6, - "hours": [ - 3, - 9, - 15, - 21 - ] - } - ], - "searchTerms": [ - { - "name": "isIssue", - "parameters": {} - }, - { - "name": "isOpen", - "parameters": {} - }, - { - "name": "hasLabel", - "parameters": { - "label": "duplicate" - } - }, - { - "name": "noActivitySince", - "parameters": { - "days": 1 - } - } - ], - "actions": [ - { - "name": "addReply", - "parameters": { - "comment": "This issue has been marked as duplicate and has not had any activity for **1 day**. It will be closed for housekeeping purposes." - } - }, - { - "name": "closeIssue", - "parameters": {} - } - ] - } - }, - { - "taskType": "trigger", - "capabilityId": "AutoMerge", - "subCapability": "AutoMerge", - "version": "1.0", - "id": "7WkkD7h8S", - "config": { - "label": "auto-merge", - "taskName": "Auto-merge pull requests", - "minMinutesOpen": "3", - "mergeType": "squash", - "deleteBranches": true, - "removeLabelOnPush": true, - "requireAllStatuses": true, - "usePrDescriptionAsCommitMessage": true, - "requireAllStatuses_exemptList": [ - "dependabot", - "DotNet Maestro" - ], - "enforceDMPAsStatus": true - }, - "disabled": false - }, - { - "taskType": "trigger", - "capabilityId": "IssueResponder", - "subCapability": "PullRequestResponder", - "version": "1.0", - "id": "etuRtolXO", - "config": { - "conditions": { - "operator": "and", - "operands": [ - { - "name": "titleContains", - "parameters": { - "titlePattern": ".+Update dependencies from dotnet/arcade .+", - "isRegex": true - } - }, - { - "name": "isActivitySender", - "parameters": { - "user": "dotnet-maestro" - } - }, - { - "name": "isAction", - "parameters": { - "action": "opened" - } - } - ] - }, - "eventType": "pull_request", - "eventNames": [ - "pull_request", - "issues", - "project_card" - ], - "taskName": "Arcade PR merger", - "actions": [ - { - "name": "addLabel", - "parameters": { - "label": "auto-merge" - } - }, - { - "name": "approvePullRequest", - "parameters": { - "comment": "Arcade update PR auto-approved." - } - } - ], - "dangerZone": { - "respondToBotActions": true, - "acceptRespondToBotActions": true - } - } - }, - { - "taskType": "trigger", - "capabilityId": "IssueResponder", - "subCapability": "PullRequestResponder", - "version": "1.0", - "id": "5h4AIqKLs", - "config": { - "conditions": { - "operator": "and", - "operands": [ - { - "name": "prTargetsBranch", - "parameters": { - "branchName": "main" - } - }, - { - "name": "activitySenderHasPermissions", - "parameters": { - "permissions": "write" - } - }, - { - "name": "isAction", - "parameters": { - "action": "opened" - } - }, - { - "operator": "or", - "operands": [ - { - "operator": "and", - "operands": [ - { - "name": "titleContains", - "parameters": { - "isRegex": true, - "titlePattern": "Localized file check-in by OneLocBuild Task: Build definition ID 2923: Build ID [0-9]+" - } - }, - { - "name": "isActivitySender", - "parameters": { - "user": "testplatform-bot" - } - } - ] - }, - { - "operator": "and", - "operands": [ - { - "name": "titleContains", - "parameters": { - "titlePattern": "LEGO\\: Pull request from lego\\/[a-z0-9_\\-]* to master", - "isRegex": true - } - }, - { - "name": "isActivitySender", - "parameters": { - "user": "csigs" - } - } - ] - } - ] - } - ] - }, - "eventType": "pull_request", - "eventNames": [ - "pull_request", - "issues", - "project_card" - ], - "taskName": "Loc PR merger", - "dangerZone": { - "respondToBotActions": true, - "acceptRespondToBotActions": true - }, - "actions": [ - { - "name": "addLabel", - "parameters": { - "label": "auto-merge" - } - }, - { - "name": "addLabel", - "parameters": { - "label": "localization" - } - }, - { - "name": "approvePullRequest", - "parameters": { - "comment": "Localization PR auto-approved." - } - } - ] - } - } - ], - "userGroups": [] -} diff --git a/.github/policies/resourceManagement.yml b/.github/policies/resourceManagement.yml new file mode 100644 index 0000000000..b3c77f150f --- /dev/null +++ b/.github/policies/resourceManagement.yml @@ -0,0 +1,112 @@ +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 + - noActivitySince: + days: 10 + - isNotLabeledWith: + label: status-no-recent-activity + actions: + - addLabel: + label: status-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 **10 days**. + - description: + frequencies: + - hourly: + hour: 6 + filters: + - isIssue + - isOpen + - hasLabel: + label: 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 + eventResponderTasks: + - if: + - payloadType: Issue_Comment + - isAction: + action: Created + - isActivitySender: + issueAuthor: True + - hasLabel: + label: needs-author-feedback + - isOpen + then: + - addLabel: + label: needs-attention + - removeLabel: + label: needs-author-feedback + description: + - if: + - payloadType: Issues + - not: + isAction: + action: Closed + - hasLabel: + label: status-no-recent-activity + then: + - removeLabel: + label: status-no-recent-activity + description: + - if: + - payloadType: Issue_Comment + - hasLabel: + label: status-no-recent-activity + then: + - removeLabel: + label: status-no-recent-activity + description: + - if: + - payloadType: Pull_Request + - hasLabel: + label: auto-merge + then: + - enableAutoMerge: + mergeMethod: Squash + description: + - if: + - payloadType: Pull_Request + - labelRemoved: + label: auto-merge + then: + - disableAutoMerge + description: + - if: + - payloadType: Pull_Request + - titleContains: + pattern: .+Update dependencies from dotnet/arcade .+ + isRegex: True + - isActivitySender: + user: dotnet-maestro + issueAuthor: False + - isAction: + action: Opened + then: + - addLabel: + label: auto-merge + - approvePullRequest: + comment: Arcade update PR auto-approved. + description: + triggerOnOwnActions: true +onFailure: +onSuccess: