Skip to content

Commit

Permalink
Merge pull request #214 from microsoftgraph/mmainer/updatepolicy
Browse files Browse the repository at this point in the history
chore: update branch protection rules, issue management workflow
  • Loading branch information
Ndiritu authored Oct 11, 2023
2 parents 745ec58 + cd41943 commit 91bd79f
Show file tree
Hide file tree
Showing 2 changed files with 164 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/policies/msgraph-beta-sdk-php-branch-protection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ configuration:
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
requiredApprovingReviewsCount: 1
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
requireCodeOwnersReview: false
requireCodeOwnersReview: true
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
requiresCommitSignatures: false
# Are conversations required to be resolved before merging? boolean
Expand All @@ -35,8 +35,9 @@ configuration:
requiresLinearHistory: false
# Required status checks to pass before merging. Values can be any string, but if the value does not correspond to any existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status
requiredStatusChecks:
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
requiresStrictStatusChecks: true
- validate-pull-request
# Require branches to be up to date before merging. This should be false since the repo contains autogenerated files. boolean
requiresStrictStatusChecks: false
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
restrictsPushes: false
# Restrict who can dismiss pull request reviews. boolean
Expand All @@ -59,7 +60,7 @@ configuration:
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
requiredApprovingReviewsCount: 1
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
requireCodeOwnersReview: false
requireCodeOwnersReview: true
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
requiresCommitSignatures: false
# Are conversations required to be resolved before merging? boolean
Expand All @@ -68,8 +69,9 @@ configuration:
requiresLinearHistory: false
# Required status checks to pass before merging. Values can be any string, but if the value does not correspond to any existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status
requiredStatusChecks:
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
requiresStrictStatusChecks: true
- validate-pull-request
# Require branches to be up to date before merging. This should be false since the repo contains autogenerated files. boolean
requiresStrictStatusChecks: false
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
restrictsPushes: false
# Restrict who can dismiss pull request reviews. boolean
Expand Down
156 changes: 156 additions & 0 deletions .github/policies/resourceManagement.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
id:
name: GitOps.PullRequestIssueManagement
description: GitOps.PullRequestIssueManagement primitive
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
scheduledSearches:
- description:
frequencies:
- hourly:
hour: 1
filters:
- isIssue
- isOpen
- hasLabel:
label: 'Needs: Author Feedback'
- hasLabel:
label: 'Status: No Recent Activity'
- noActivitySince:
days: 3
- isNotLabeledWith:
label: Service Bug
actions:
- closeIssue
- description:
frequencies:
- hourly:
hour: 1
filters:
- isIssue
- isOpen
- hasLabel:
label: 'Needs: Author Feedback'
- noActivitySince:
days: 4
- isNotLabeledWith:
label: 'Status: No Recent Activity'
- isNotLabeledWith:
label: Service Bug
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 **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
- description:
frequencies:
- hourly:
hour: 1
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
- description:
frequencies:
- hourly:
hour: 1
filters:
- isOpen
- hasLabel:
label: 'API: Graph'
- noActivitySince:
days: 14
actions:
- addLabel:
label: Service issue
- addReply:
reply: >-
Hello @${issueAuthor}
Thank you for reporting your concern. If you report this issue in the Microsoft Q&A forum, it will get routed to the appropriate team for them to triage.
https://aka.ms/askgraph
eventResponderTasks:
- if:
- payloadType: Issues
- and:
- isOpen
- not:
and:
- isAssignedToSomeone
- isLabeled
then:
- addLabel:
label: 'ToTriage'
- if:
- payloadType: Issue_Comment
- isAction:
action: Created
- isActivitySender:
issueAuthor: True
- hasLabel:
label: 'Needs: Author Feedback'
then:
- addLabel:
label: "Needs: Attention \U0001F44B"
- 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
- activitySenderHasAssociation:
association: Contributor
- bodyContains:
pattern: '?'
isRegex: False
- bodyContains:
pattern: '@'
isRegex: False
then:
- addLabel:
label: 'Needs: Author Feedback'
description:
- if:
- payloadType: Issue_Comment
- hasLabel:
label: 'API: Graph'
then:
- addReply:
reply: >-
Hello @${issueAuthor}
Thank you for reporting your concern. If you report this issue in the Microsoft Q&A forum, it will get routed to the appropriate team for them to triage.
https://aka.ms/askgraph
This issue will now be closed. If you encounter any issues in the future, please feel free to open an issue.
- addLabel:
label: Service issue
- closeIssue
description:
onFailure:
onSuccess:

0 comments on commit 91bd79f

Please sign in to comment.