-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into wara-guidance
- Loading branch information
Showing
356 changed files
with
23,507 additions
and
4,002 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"log_level": "info", | ||
"ado": { | ||
"organization": "CSUSolEng", | ||
"project": "Well-Architected Framework", | ||
"wit": "GitHub Issue", | ||
"states": { | ||
"new": "New", | ||
"closed": "Closed", | ||
"reopened": "New", | ||
"deleted": "Removed", | ||
"active": "In Progress" | ||
}, | ||
"bypassRules": true, | ||
"autoCreate": true, | ||
"areaPath": "Well-Architected Framework" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,284 @@ | ||
name: GitOps.PullRequestIssueManagement | ||
description: GitHub policy for triaging and managing pull requests and issues. | ||
resource: repository | ||
disabled: false | ||
|
||
where: | ||
configuration: | ||
resourceManagementConfiguration: | ||
scheduledSearches: | ||
- description: 'If if open issue and label Needs: Author Feedback :ear: and Status: No Recent Activity :desert: with no update after 3 days, then close the issue.' | ||
frequencies: | ||
- hourly: | ||
hour: 3 | ||
filters: | ||
- isIssue | ||
- isOpen | ||
- hasLabel: | ||
label: 'Needs: Author Feedback :ear:' | ||
- hasLabel: | ||
label: 'Status: No Recent Activity :desert:' | ||
- noActivitySince: | ||
days: 3 | ||
actions: | ||
- closeIssue | ||
|
||
- description: 'If open issue and label is Needs: Author Feedback :ear: is applied with no update after 3 days, then apply label "Status: No Recent Activity :desert:' | ||
frequencies: | ||
- hourly: | ||
hour: 3 | ||
filters: | ||
- isIssue | ||
- isOpen | ||
- hasLabel: | ||
label: 'Needs: Author Feedback :ear:' | ||
- noActivitySince: | ||
days: 3 | ||
- isNotLabeledWith: | ||
label: 'Status: No Recent Activity :desert:' | ||
actions: | ||
- addLabel: | ||
label: 'Status: No Recent Activity :desert:' | ||
- 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: 'If open issue and label is Resolution: Duplicate :file_cabinet: with no activity for 1 day, close issue.' | ||
frequencies: | ||
- hourly: | ||
hour: 3 | ||
filters: | ||
- isIssue | ||
- isOpen | ||
- hasLabel: | ||
label: 'Resolution: Duplicate :file_cabinet:' | ||
- 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: 'If open pr and label includes Needs: Author Feedback :ear: and Status: No Recent Activity :desert: with no update after 7 days, then close the issue.' | ||
frequencies: | ||
- hourly: | ||
hour: 3 | ||
filters: | ||
- isPullRequest | ||
- isOpen | ||
- hasLabel: | ||
label: 'Needs: Author Feedback :ear:' | ||
- hasLabel: | ||
label: 'Status: No Recent Activity :desert:' | ||
- noActivitySince: | ||
days: 7 | ||
actions: | ||
- closePullRequest | ||
|
||
- description: 'If open pull request and label includes Needs: Author Feedback :ear: and has not been updated in 7 days, then add label and request update.' | ||
frequencies: | ||
- hourly: | ||
hour: 3 | ||
filters: | ||
- isPullRequest | ||
- isOpen | ||
- hasLabel: | ||
label: 'Needs: Author Feedback :ear:' | ||
- noActivitySince: | ||
days: 7 | ||
- isNotLabeledWith: | ||
label: 'Status: No Recent Activity :desert:' | ||
actions: | ||
- addLabel: | ||
label: 'Status: No Recent Activity :desert:' | ||
- 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 | ||
- titleContains: | ||
pattern: "Bug Report" | ||
isRegex: false | ||
then: | ||
- addLabel: | ||
label: "Bug :lady_beetle:" | ||
description: 'If issue title contains Bug Report, then add label.' | ||
|
||
- if: | ||
- payloadType: Issues | ||
- titleContains: | ||
pattern: "Feature Request" | ||
isRegex: false | ||
then: | ||
- addLabel: | ||
label: "Enhancement :new:" | ||
description: 'If issue title contains Feature Request, then add label.' | ||
|
||
- if: | ||
- payloadType: Pull_Request | ||
- titleContains: | ||
pattern: "feat:" | ||
isRegex: false | ||
then: | ||
- addLabel: | ||
label: "Enhancement :new:" | ||
description: 'If pr title contains feat:, then add label.' | ||
|
||
- if: | ||
- payloadType: Pull_Request | ||
- titleContains: | ||
pattern: "build:" | ||
isRegex: false | ||
then: | ||
- addLabel: | ||
label: "Type: Hygiene :broom:" | ||
description: 'If pr title contains build:, then add label.' | ||
|
||
- if: | ||
- payloadType: Pull_Request | ||
- titleContains: | ||
pattern: "fix:" | ||
isRegex: false | ||
then: | ||
- addLabel: | ||
label: "Bug :lady_beetle:" | ||
description: 'If pr title contains fix:, then add label.' | ||
|
||
- 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 author comments on issue with label Needs: Author Feedback :ear:, then adjust labels' | ||
|
||
- if: | ||
- payloadType: Issues | ||
- not: | ||
isAction: | ||
action: Closed | ||
- hasLabel: | ||
label: 'Status: No Recent Activity :desert:' | ||
then: | ||
- removeLabel: | ||
label: 'Status: No Recent Activity :desert:' | ||
description: 'If issue is closed and had Status: No Recent Activity :desert:, then remove the label.' | ||
|
||
- if: | ||
- payloadType: Issue_Comment | ||
- hasLabel: | ||
label: 'Status: No Recent Activity :desert:' | ||
then: | ||
- removeLabel: | ||
label: 'Status: No Recent Activity :desert:' | ||
description: 'If comment on issue and has label Status: No Recent Activity :desert:, then remove the label.' | ||
|
||
- if: | ||
- payloadType: Pull_Request | ||
- isAction: | ||
action: Submitted | ||
- isReviewState: | ||
reviewState: Changes_requested | ||
then: | ||
- addLabel: | ||
label: 'Needs: Author Feedback :ear:' | ||
description: 'If pr has review that requests changes, then add label.' | ||
|
||
- 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 pr has label Needs: Author Feedback :ear: and is closed, then remove label.' | ||
|
||
- if: | ||
- payloadType: Issue_Comment | ||
- isActivitySender: | ||
issueAuthor: True | ||
- hasLabel: | ||
label: 'Needs: Author Feedback :ear:' | ||
then: | ||
- removeLabel: | ||
label: 'Needs: Author Feedback :ear:' | ||
description: 'If issue has label Needs: Author Feedback :ear: and author comments, then remove label.' | ||
|
||
- if: | ||
- payloadType: Pull_Request | ||
- isActivitySender: | ||
issueAuthor: True | ||
- hasLabel: | ||
label: 'Needs: Author Feedback :ear:' | ||
then: | ||
- removeLabel: | ||
label: 'Needs: Author Feedback :ear:' | ||
description: 'If pull request has label Needs: Author Feedback :ear: and author updates, then remove label.' | ||
|
||
- if: | ||
- payloadType: Pull_Request | ||
- not: | ||
isAction: | ||
action: Closed | ||
- hasLabel: | ||
label: 'Status: No Recent Activity :desert:' | ||
then: | ||
- removeLabel: | ||
label: 'Status: No Recent Activity :desert:' | ||
description: 'If pull request has label Status: No Recent Activity :desert: and is closed, then remove label.' | ||
|
||
- if: | ||
- payloadType: Issue_Comment | ||
- hasLabel: | ||
label: 'Status: No Recent Activity :desert:' | ||
then: | ||
- removeLabel: | ||
label: 'Status: No Recent Activity :desert:' | ||
description: 'If issue has new comment and has label Status: No Recent Activity :desert:, then remove label.' | ||
|
||
- if: | ||
- payloadType: Pull_Request | ||
- hasLabel: | ||
label: 'Status: No Recent Activity :desert:' | ||
then: | ||
- removeLabel: | ||
label: 'Status: No Recent Activity :desert:' | ||
description: 'If pull request has update and has label Status: No Recent Activity :desert:, then remove label.' | ||
|
||
- if: | ||
- payloadType: Issue_Comment | ||
then: | ||
- cleanEmailReply | ||
description: 'If issue has new comment then perform cleanEmailReply action.' | ||
|
||
- if: | ||
- payloadType: Pull_Request | ||
- hasLabel: | ||
label: 'Auto-Merge :heavy_check_mark:' | ||
then: | ||
- enableAutoMerge: | ||
mergeMethod: Squash | ||
description: 'If pr opened and has label auto-merge :heavy_check_mark: added, then disableAutoMerge.' | ||
|
||
- if: | ||
- payloadType: Pull_Request | ||
- labelRemoved: | ||
label: 'Auto-Merge :heavy_check_mark:' | ||
then: | ||
- disableAutoMerge | ||
description: 'If pr opened and has label auto-merge :heavy_check_mark: removed, then disableAutoMerge.' | ||
onFailure: | ||
onSuccess: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
install-module powershell-yaml -force -scope currentuser | ||
|
||
function Build-APRLJsonObject { | ||
param ( | ||
[string]$path | ||
) | ||
|
||
$kqlfiles = Get-ChildItem -Path $path -Recurse -Filter "*.kql" | ||
$yamlfiles = Get-ChildItem -Path $path -Recurse -Filter "*.yaml" | ||
|
||
$yamlobj = foreach($file in $yamlfiles){ | ||
$content = Get-Content $file.FullName -Raw | ConvertFrom-Yaml | ||
$content | Select-Object publishedToAdvisor,aprlGuid,recommendationTypeId,recommendationMetadataState,learnMoreLink,recommendationControl,longDescription,pgVerified,description,potentialBenefits,publishedToLearn,tags,recommendationResourceType,recommendationImpact,automationAvailable,query | ||
} | ||
|
||
$kqlobj = foreach($file in $kqlfiles){ | ||
$content = Get-Content $file.FullName -Raw | ||
[PSCustomObject]@{ | ||
AprlGUID = $file.Name -replace ".kql","" | ||
Query = $content | ||
} | ||
} | ||
|
||
$aprlobj = foreach($obj in $yamlobj){ | ||
$obj.query = $($kqlobj.Where{$_.AprlGUID -eq $obj.aprlGuid}).Query | ||
$obj | ||
} | ||
return $aprlobj | ||
} | ||
|
||
#Try to build and export the object. If it fails, catch the error and exit with code 1 | ||
try{ | ||
Build-APRLJsonObject -path "./azure-resources" | ConvertTo-Json -Depth 10 | Out-File -FilePath "./tools/data/recommendations.json" -Force | ||
exit 0 | ||
} | ||
catch{ | ||
Write-Error $_.Exception.Message | ||
exit 1 | ||
} |
Oops, something went wrong.