Skip to content

Commit 9d13803

Browse files
authored
Merge branch 'Azure:main' into master
2 parents 3489392 + 4cfdce0 commit 9d13803

File tree

25,264 files changed

+4892861
-6739692
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

25,264 files changed

+4892861
-6739692
lines changed

.github/CODEOWNERS

Lines changed: 625 additions & 0 deletions
Large diffs are not rendered by default.

.github/CODEOWNERS_baseline_errors.txt

Lines changed: 219 additions & 0 deletions
Large diffs are not rendered by default.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Thank you for opening a bug report. For faster processing, please include:
1212
- import path of package in question, e.g. `.../services/compute/mgmt/2018-06-01/compute`
1313
- SDK version e.g. `master`, `latest`, `18.1.0`
1414
- Specify the exact commit if possible; one way to get this is the REVISION
15-
column output by `dep status "github.com/Azure/azure-sdk-for-go`.
15+
column output by `go list -m <module>`, for example `go list -m github.com/Azure/azure-sdk-for-go/sdk/azcore`.
1616
- output of `go version`
1717

1818
<!--

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ Please verify the following before submitting your PR, thank you!
88
- [ ] The PR does not update generated files.
99
- These files are managed by the codegen framework at [Azure/autorest.go][].
1010
- [ ] Tests are included and/or updated for code changes.
11-
- [ ] Updates to [CHANGELOG.md][] are included.
12-
- [ ] Apache v2 license headers are included in each file.
13-
11+
- [ ] Updates to module CHANGELOG.md are included.
12+
- [ ] MIT license headers are included in each file.
13+
1414
[Azure/autorest.go]: https://github.com/Azure/autorest.go
15-
[CHANGELOG.md]: https://github.com/Azure/azure-sdk-for-go/blob/master/CHANGELOG.md

.github/event-processor.config

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"InitialIssueTriage": "On",
3+
"ManualIssueTriage": "On",
4+
"ServiceAttention": "On",
5+
"ManualTriageAfterExternalAssignment": "On",
6+
"RequireAttentionForNonMilestone": "On",
7+
"AuthorFeedbackNeeded": "On",
8+
"IssueAddressed": "On",
9+
"IssueAddressedReset": "On",
10+
"AuthorFeedback": "On",
11+
"ReopenIssue": "On",
12+
"DeclineToReopenIssue": "On",
13+
"IssueAddressedCommands": "On",
14+
"PullRequestTriage": "On",
15+
"ResetApprovalsForUntrustedChanges": "On",
16+
"ReopenPullRequest": "On",
17+
"ResetIssueActivity": "On",
18+
"ResetPullRequestActivity": "On",
19+
"CloseStaleIssues": "On",
20+
"CloseStalePullRequests": "On",
21+
"IdentifyStaleIssues": "On",
22+
"IdentifyStalePullRequests": "On",
23+
"CloseAddressedIssues": "On",
24+
"LockClosedIssues": "On",
25+
"EnforceMaxLifeOfIssues": "Off"
26+
}

.github/no-response.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/event-processor.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: GitHub Event Processor
2+
3+
on:
4+
issues:
5+
types: [edited, labeled, opened, reopened, unlabeled]
6+
# issue_comment is used for both issues and pull_requests
7+
# github.event.issue.pull_request will be non-null on pull request comments
8+
issue_comment:
9+
types: [created]
10+
# synchronize is the pull_request_target event when changes are pushed
11+
# pull request merged is the closed event with github.event.pull_request.merged = true
12+
pull_request_target:
13+
types: [closed, labeled, opened, reopened, review_requested, synchronize, unlabeled]
14+
15+
# This removes all unnecessary permissions, the ones needed will be set below.
16+
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
17+
permissions: {}
18+
19+
jobs:
20+
event-handler:
21+
permissions:
22+
issues: write
23+
pull-requests: write
24+
# For OIDC auth
25+
id-token: write
26+
contents: read
27+
name: Handle ${{ github.event_name }} ${{ github.event.action }} event
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: 'Az CLI login'
31+
if: ${{ github.event_name == 'issues' && github.event.action == 'opened' }}
32+
uses: azure/[email protected]
33+
with:
34+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
35+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
36+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
37+
38+
- name: 'Run Azure CLI commands'
39+
if: ${{ github.event_name == 'issues' && github.event.action == 'opened' }}
40+
run: |
41+
LABEL_SERVICE_API_KEY=$(az keyvault secret show \
42+
--vault-name issue-labeler \
43+
-n issue-labeler-func-key \
44+
-o tsv \
45+
--query value)
46+
47+
echo "::add-mask::$LABEL_SERVICE_API_KEY"
48+
echo "LABEL_SERVICE_API_KEY=$LABEL_SERVICE_API_KEY" >> $GITHUB_ENV
49+
50+
# To run github-event-processor built from source, for testing purposes, uncomment everything
51+
# in between the Start/End-Build From Source comments and comment everything in between the
52+
# Start/End-Install comments
53+
# Start-Install
54+
- name: Install GitHub Event Processor
55+
run: >
56+
dotnet tool install
57+
Azure.Sdk.Tools.GitHubEventProcessor
58+
--version 1.0.0-dev.20240229.2
59+
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json
60+
--global
61+
shell: bash
62+
# End-Install
63+
64+
# Testing checkout of sources from the Azure/azure-sdk-tools repository
65+
# The ref: is the SHA from the pull request in that repository or the
66+
# refs/pull/<PRNumber>/merge for the latest on any given PR. If the repository
67+
# is a fork eg. <User>/azure-sdk-tools then the repository down below will
68+
# need to point to that fork
69+
# Start-Build
70+
# - name: Checkout tools repo for GitHub Event Processor sources
71+
# uses: actions/checkout@v3
72+
# with:
73+
# repository: Azure/azure-sdk-tools
74+
# path: azure-sdk-tools
75+
# ref: <refs/pull/<PRNumber>/merge> or <sha>
76+
77+
# - name: Build and install GitHubEventProcessor from sources
78+
# run: |
79+
# dotnet pack
80+
# dotnet tool install --global --prerelease --add-source ../../../artifacts/packages/Debug Azure.Sdk.Tools.GitHubEventProcessor
81+
# shell: bash
82+
# working-directory: azure-sdk-tools/tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
83+
# End-Build
84+
85+
- name: Process Action Event
86+
run: |
87+
cat > payload.json << 'EOF'
88+
${{ toJson(github.event) }}
89+
EOF
90+
github-event-processor ${{ github.event_name }} payload.json
91+
shell: bash
92+
env:
93+
# This is a temporary secret generated by github
94+
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
95+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96+
LABEL_SERVICE_API_KEY: ${{ env.LABEL_SERVICE_API_KEY }}

.github/workflows/event.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# NOTE: currently azure-sdk-actions only hosts check enforcer code.
2+
# If further functionality is added, this name should be updated to reflect
3+
# the more generic behavior
4+
name: Check Enforcer
5+
6+
on:
7+
check_suite:
8+
types: [completed]
9+
issue_comment:
10+
types: [created]
11+
12+
permissions: {}
13+
14+
jobs:
15+
event-handler:
16+
permissions:
17+
statuses: write # to set status (azure/azure-sdk-actions)
18+
pull-requests: write # to read pull requests and write comments (azure/azure-sdk-actions)
19+
checks: read # to read check status (azure/azure-sdk-actions)
20+
name: Handle ${{ github.event_name }} ${{ github.event.action }} event
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: azure/azure-sdk-actions@main
24+
with:
25+
token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: GitHub Scheduled Event Processor
2+
3+
on:
4+
schedule:
5+
# Close stale issues, runs every day at 1am - CloseStaleIssues
6+
- cron: '0 1 * * *'
7+
# Identify stale pull requests, every Friday at 5am - IdentifyStalePullRequests
8+
- cron: '0 5 * * FRI'
9+
# Close stale pull requests, every 6 hours at 02:30 AM, 08:30 AM, 02:30 PM and 08:30 PM - CloseStalePullRequests
10+
- cron: '30 2,8,14,20 * * *'
11+
# Identify stale issues, every 6 hours at 03:30 AM, 09:30 AM, 03:30 PM and 09:30 PM - IdentifyStaleIssues
12+
- cron: '30 3,9,15,21 * * *'
13+
# Close addressed issues, every 6 hours at 04:30 AM, 10:30 AM, 04:30 PM and 10:30 PM - CloseAddressedIssues
14+
- cron: '30 4,10,16,22 * * *'
15+
# Lock closed issues, every 6 hours at 05:30 AM, 11:30 AM, 05:30 PM and 11:30 PM - LockClosedIssues
16+
- cron: '30 5,11,17,23 * * *'
17+
# Enforce max life of issues, every Monday at 10:00 AM - EnforceMaxLifeOfIssues
18+
# Note: GitHub uses UTC, to run at 10am PST, the cron task needs to be 6pm (1800 hours) UTC
19+
- cron: '0 18 * * MON'
20+
# This removes all unnecessary permissions, the ones needed will be set below.
21+
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
22+
permissions: {}
23+
24+
jobs:
25+
event-handler:
26+
permissions:
27+
issues: write
28+
pull-requests: write
29+
name: Handle ${{ github.event.schedule }} ${{ github.event.action }} event
30+
runs-on: ubuntu-latest
31+
steps:
32+
# To run github-event-processor built from source, for testing purposes, uncomment everything
33+
# in between the Start/End-Build From Source comments and comment everything in between the
34+
# Start/End-Install comments
35+
# Start-Install
36+
- name: Install GitHub Event Processor
37+
run: >
38+
dotnet tool install
39+
Azure.Sdk.Tools.GitHubEventProcessor
40+
--version 1.0.0-dev.20240229.2
41+
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json
42+
--global
43+
shell: bash
44+
# End-Install
45+
46+
# Testing checkout of sources from the Azure/azure-sdk-tools repository
47+
# The ref: is the SHA from the pull request in that repository or the
48+
# refs/pull/<PRNumber>/merge for the latest on any given PR. If the repository
49+
# is a fork eg. <User>/azure-sdk-tools then the repository down below will
50+
# need to point to that fork
51+
# Start-Build
52+
# - name: Checkout tools repo for GitHub Event Processor sources
53+
# uses: actions/checkout@v3
54+
# with:
55+
# repository: Azure/azure-sdk-tools
56+
# path: azure-sdk-tools
57+
# ref: <refs/pull/<PRNumber>/merge> or <sha>
58+
59+
# - name: Build and install GitHubEventProcessor from sources
60+
# run: |
61+
# dotnet pack
62+
# dotnet tool install --global --prerelease --add-source ../../../artifacts/packages/Debug Azure.Sdk.Tools.GitHubEventProcessor
63+
# shell: bash
64+
# working-directory: azure-sdk-tools/tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
65+
# End-Build
66+
67+
- name: Close Stale Issues Scheduled Event
68+
if: github.event.schedule == '0 1 * * *'
69+
run: |
70+
cat > payload.json << 'EOF'
71+
${{ toJson(github.event) }}
72+
EOF
73+
github-event-processor ${{ github.event_name }} payload.json CloseStaleIssues
74+
shell: bash
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
78+
- name: Identify Stale PullRequests Scheduled Event
79+
if: github.event.schedule == '0 5 * * FRI'
80+
run: |
81+
cat > payload.json << 'EOF'
82+
${{ toJson(github.event) }}
83+
EOF
84+
github-event-processor ${{ github.event_name }} payload.json IdentifyStalePullRequests
85+
shell: bash
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
89+
- name: Close Stale PullRequests Scheduled Event
90+
if: github.event.schedule == '30 2,8,14,20 * * *'
91+
run: |
92+
cat > payload.json << 'EOF'
93+
${{ toJson(github.event) }}
94+
EOF
95+
github-event-processor ${{ github.event_name }} payload.json CloseStalePullRequests
96+
shell: bash
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
100+
- name: Identify Stale Issues Scheduled Event
101+
if: github.event.schedule == '30 3,9,15,21 * * *'
102+
run: |
103+
cat > payload.json << 'EOF'
104+
${{ toJson(github.event) }}
105+
EOF
106+
github-event-processor ${{ github.event_name }} payload.json IdentifyStaleIssues
107+
shell: bash
108+
env:
109+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110+
111+
- name: Close Addressed Issues Scheduled Event
112+
if: github.event.schedule == '30 4,10,16,22 * * *'
113+
run: |
114+
cat > payload.json << 'EOF'
115+
${{ toJson(github.event) }}
116+
EOF
117+
github-event-processor ${{ github.event_name }} payload.json CloseAddressedIssues
118+
shell: bash
119+
env:
120+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121+
122+
- name: Lock Closed Issues Scheduled Event
123+
if: github.event.schedule == '30 5,11,17,23 * * *'
124+
run: |
125+
cat > payload.json << 'EOF'
126+
${{ toJson(github.event) }}
127+
EOF
128+
github-event-processor ${{ github.event_name }} payload.json LockClosedIssues
129+
shell: bash
130+
env:
131+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
132+
133+
- name: Enforce Max Life of Issues Scheduled Event
134+
if: github.event.schedule == '0 18 * * MON'
135+
run: |
136+
cat > payload.json << 'EOF'
137+
${{ toJson(github.event) }}
138+
EOF
139+
github-event-processor ${{ github.event_name }} payload.json EnforceMaxLifeOfIssues
140+
shell: bash
141+
env:
142+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ _testmain.go
3535
*~
3636
.DS_Store
3737
.vscode
38+
.vs
39+
.idea
3840

3941
# ignore vendor/
4042
vendor/
43+
44+
# environment variables
45+
.env
46+
47+
# vscode
48+
**/.vscode/*
49+
!.vscode/cspell.json
50+
51+
# api view file
52+
*.gosource
53+
54+
# Default Test Proxy Assets restore directory
55+
.assets
56+
57+
# Default Test Proxy tools install directory
58+
.proxy

0 commit comments

Comments
 (0)