Skip to content

hygeine: Triage policies #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
279 changes: 279 additions & 0 deletions .github/policies/resourceManagement.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
id:
name: GitOps.PullRequestIssueManagement
description: GitOps.PullRequestIssueManagement primitive
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
scheduledSearches:
- description:
frequencies:
- hourly:
hour: 3
filters:
- isIssue
- isOpen
- hasLabel:
label: "Needs: Author Feedback :ear:"
- hasLabel:
label: "Status: No Recent Activity :zzz:"
- noActivitySince:
days: 3
actions:
- closeIssue
- description:
frequencies:
- hourly:
hour: 3
filters:
- isIssue
- isOpen
- hasLabel:
label: "Needs: Author Feedback :ear:"
- noActivitySince:
days: 4
- isNotLabeledWith:
label: "Status: No Recent Activity :zzz:"
actions:
- addLabel:
label: "Status: No Recent Activity :zzz:"
- 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: 3
filters:
- isIssue
- isOpen
- hasLabel:
label: "Type: Duplicate :palms_up_together:"
- 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: 3
filters:
- isPullRequest
- isOpen
- hasLabel:
label: "Needs: Author Feedback :ear:"
- hasLabel:
label: "Status: No Recent Activity :zzz:"
- noActivitySince:
days: 7
actions:
- closeIssue
- description:
frequencies:
- hourly:
hour: 3
filters:
- isPullRequest
- isOpen
- hasLabel:
label: "Needs: Author Feedback :ear:"
- noActivitySince:
days: 7
- isNotLabeledWith:
label: "Status: No Recent Activity :zzz:"
actions:
- addLabel:
label: "Status: No Recent Activity :zzz:"
- 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: Issue_Comment
- isAction:
action: Created
- isActivitySender:
issueAuthor: True
- hasLabel:
label: "Needs: Author Feedback :ear:"
- isOpen
then:
- addLabel:
label: "Needs: Attention :wave:"
- removeLabel:
label: "Needs: Author Feedback :ear:"
description:
- if:
- payloadType: Issues
- not:
isAction:
action: Closed
- hasLabel:
label: "Status: No Recent Activity :zzz:"
then:
- removeLabel:
label: "Status: No Recent Activity :zzz:"
description:
- if:
- payloadType: Issue_Comment
- hasLabel:
label: "Status: No Recent Activity :zzz:"
then:
- removeLabel:
label: "Status: No Recent Activity :zzz:"
description:
- if:
- payloadType: Pull_Request
then:
- inPrLabel:
label: "Status: In PR :point_right:"
description:
- if:
- payloadType: Pull_Request_Review
- isAction:
action: Submitted
- isReviewState:
reviewState: Changes_requested
then:
- addLabel:
label: "Needs: Author Feedback :ear:"
description:
- if:
- payloadType: Pull_Request
- isActivitySender:
issueAuthor: True
- not:
isAction:
action: Closed
- hasLabel:
label: "Needs: Author Feedback :ear:"
then:
- removeLabel:
label: "Needs: Author Feedback :ear:"
description:
- if:
- payloadType: Issue_Comment
- isActivitySender:
issueAuthor: True
- hasLabel:
label: "Needs: Author Feedback :ear:"
then:
- removeLabel:
label: "Needs: Author Feedback :ear:"
description:
- if:
- payloadType: Pull_Request_Review
- isActivitySender:
issueAuthor: True
- hasLabel:
label: "Needs: Author Feedback :ear:"
then:
- removeLabel:
label: "Needs: Author Feedback :ear:"
description:
- if:
- payloadType: Pull_Request
- not:
isAction:
action: Closed
- hasLabel:
label: "Status: No Recent Activity :zzz:"
then:
- removeLabel:
label: "Status: No Recent Activity :zzz:"
description:
- if:
- payloadType: Issue_Comment
- hasLabel:
label: "Status: No Recent Activity :zzz:"
then:
- removeLabel:
label: "Status: No Recent Activity :zzz:"
description:
- if:
- payloadType: Pull_Request_Review
- hasLabel:
label: "Status: No Recent Activity :zzz:"
then:
- removeLabel:
label: "Status: No Recent Activity :zzz:"
description:
- if:
- payloadType: Issue_Comment
then:
- cleanEmailReply
description:
- if:
- payloadType: Pull_Request
- isAction:
action: Opened
- or:
- includesModifiedFiles:
files:
- infra-as-code/bicep/modules/policy/definitions/lib
- includesModifiedFiles:
files:
- infra-as-code/bicep/modules/policy/assignments/lib/policy_assignments
then:
- addReply:
reply: >-
Hey ${issueAuthor}, thanks for creating this PR.


We noticed that this PR is ammending some things related to policies (definitions or assignments) :mag:


Thanks for this however, please keep in mind we replicate all policies from our upstream repo https://github.com/Azure/Enterprise-Scale (via some GitHub Actions) into these Bicep modules.


So it may be that this PR may be closed and we ask you to re-submit the changes to the respective code in our other repo.


However, we will review and advise further anyway but this is just a friendly premptive message and reminder of how policies are used and updated in this repo.


Thanks from your friendly msft-bot.
- addLabel:
label: "Area: Policy"
description:
- if:
- payloadType: Pull_Request
- labelAdded:
label: "Needs: Upstream Policy Changes :arrows_clockwise:"
then:
- addReply:
reply: >-
Hey ${issueAuthor}, thanks for creating this PR.


We noticed that this PR is ammending some things related to policies (definitions or assignments) :mag:


Thanks for this however, please keep in mind we replicate all policies from our upstream repo https://github.com/Azure/Enterprise-Scale (via some GitHub Actions) into these Bicep modules.


We have determined, upon our review, that the changes here are required to be made to the upstream policies in the repo: https://github.com/Azure/Enterprise-Scale


Thanks from the team and our friendly msft-bot.
- closeIssue
description:
- if:
- payloadType: Pull_Request
- hasLabel:
label: "auto-merge :heavy_check_mark:"
then:
- enableAutoMerge:
mergeMethod: Squash
description:
- if:
- payloadType: Pull_Request
- labelRemoved:
label: "auto-merge :heavy_check_mark:"
then:
- disableAutoMerge
description:
onFailure:
onSuccess:
17 changes: 17 additions & 0 deletions .github/workflows/pr-title-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: .Platform - Semantic PR Check

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR Title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading