Skip to content

Commit

Permalink
Merge branch 'Azure:main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
JackTn authored Mar 8, 2024
2 parents 3489392 + 4cfdce0 commit 9d13803
Show file tree
Hide file tree
Showing 25,264 changed files with 4,892,861 additions and 6,739,692 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
625 changes: 625 additions & 0 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

219 changes: 219 additions & 0 deletions .github/CODEOWNERS_baseline_errors.txt

Large diffs are not rendered by default.

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

<!--
Expand Down
7 changes: 3 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ Please verify the following before submitting your PR, thank you!
- [ ] The PR does not update generated files.
- These files are managed by the codegen framework at [Azure/autorest.go][].
- [ ] Tests are included and/or updated for code changes.
- [ ] Updates to [CHANGELOG.md][] are included.
- [ ] Apache v2 license headers are included in each file.
- [ ] Updates to module CHANGELOG.md are included.
- [ ] MIT license headers are included in each file.

[Azure/autorest.go]: https://github.com/Azure/autorest.go
[CHANGELOG.md]: https://github.com/Azure/azure-sdk-for-go/blob/master/CHANGELOG.md
26 changes: 26 additions & 0 deletions .github/event-processor.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"InitialIssueTriage": "On",
"ManualIssueTriage": "On",
"ServiceAttention": "On",
"ManualTriageAfterExternalAssignment": "On",
"RequireAttentionForNonMilestone": "On",
"AuthorFeedbackNeeded": "On",
"IssueAddressed": "On",
"IssueAddressedReset": "On",
"AuthorFeedback": "On",
"ReopenIssue": "On",
"DeclineToReopenIssue": "On",
"IssueAddressedCommands": "On",
"PullRequestTriage": "On",
"ResetApprovalsForUntrustedChanges": "On",
"ReopenPullRequest": "On",
"ResetIssueActivity": "On",
"ResetPullRequestActivity": "On",
"CloseStaleIssues": "On",
"CloseStalePullRequests": "On",
"IdentifyStaleIssues": "On",
"IdentifyStalePullRequests": "On",
"CloseAddressedIssues": "On",
"LockClosedIssues": "On",
"EnforceMaxLifeOfIssues": "Off"
}
13 changes: 0 additions & 13 deletions .github/no-response.yml

This file was deleted.

96 changes: 96 additions & 0 deletions .github/workflows/event-processor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: GitHub Event Processor

on:
issues:
types: [edited, labeled, opened, reopened, unlabeled]
# issue_comment is used for both issues and pull_requests
# github.event.issue.pull_request will be non-null on pull request comments
issue_comment:
types: [created]
# synchronize is the pull_request_target event when changes are pushed
# pull request merged is the closed event with github.event.pull_request.merged = true
pull_request_target:
types: [closed, labeled, opened, reopened, review_requested, synchronize, unlabeled]

# This removes all unnecessary permissions, the ones needed will be set below.
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
permissions: {}

jobs:
event-handler:
permissions:
issues: write
pull-requests: write
# For OIDC auth
id-token: write
contents: read
name: Handle ${{ github.event_name }} ${{ github.event.action }} event
runs-on: ubuntu-latest
steps:
- name: 'Az CLI login'
if: ${{ github.event_name == 'issues' && github.event.action == 'opened' }}
uses: azure/login@v1.5.1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: 'Run Azure CLI commands'
if: ${{ github.event_name == 'issues' && github.event.action == 'opened' }}
run: |
LABEL_SERVICE_API_KEY=$(az keyvault secret show \
--vault-name issue-labeler \
-n issue-labeler-func-key \
-o tsv \
--query value)
echo "::add-mask::$LABEL_SERVICE_API_KEY"
echo "LABEL_SERVICE_API_KEY=$LABEL_SERVICE_API_KEY" >> $GITHUB_ENV
# To run github-event-processor built from source, for testing purposes, uncomment everything
# in between the Start/End-Build From Source comments and comment everything in between the
# Start/End-Install comments
# Start-Install
- name: Install GitHub Event Processor
run: >
dotnet tool install
Azure.Sdk.Tools.GitHubEventProcessor
--version 1.0.0-dev.20240229.2
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json
--global
shell: bash
# End-Install

# Testing checkout of sources from the Azure/azure-sdk-tools repository
# The ref: is the SHA from the pull request in that repository or the
# refs/pull/<PRNumber>/merge for the latest on any given PR. If the repository
# is a fork eg. <User>/azure-sdk-tools then the repository down below will
# need to point to that fork
# Start-Build
# - name: Checkout tools repo for GitHub Event Processor sources
# uses: actions/checkout@v3
# with:
# repository: Azure/azure-sdk-tools
# path: azure-sdk-tools
# ref: <refs/pull/<PRNumber>/merge> or <sha>

# - name: Build and install GitHubEventProcessor from sources
# run: |
# dotnet pack
# dotnet tool install --global --prerelease --add-source ../../../artifacts/packages/Debug Azure.Sdk.Tools.GitHubEventProcessor
# shell: bash
# working-directory: azure-sdk-tools/tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
# End-Build

- name: Process Action Event
run: |
cat > payload.json << 'EOF'
${{ toJson(github.event) }}
EOF
github-event-processor ${{ github.event_name }} payload.json
shell: bash
env:
# This is a temporary secret generated by github
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LABEL_SERVICE_API_KEY: ${{ env.LABEL_SERVICE_API_KEY }}
25 changes: 25 additions & 0 deletions .github/workflows/event.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# NOTE: currently azure-sdk-actions only hosts check enforcer code.
# If further functionality is added, this name should be updated to reflect
# the more generic behavior
name: Check Enforcer

on:
check_suite:
types: [completed]
issue_comment:
types: [created]

permissions: {}

jobs:
event-handler:
permissions:
statuses: write # to set status (azure/azure-sdk-actions)
pull-requests: write # to read pull requests and write comments (azure/azure-sdk-actions)
checks: read # to read check status (azure/azure-sdk-actions)
name: Handle ${{ github.event_name }} ${{ github.event.action }} event
runs-on: ubuntu-latest
steps:
- uses: azure/azure-sdk-actions@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
142 changes: 142 additions & 0 deletions .github/workflows/scheduled-event-processor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: GitHub Scheduled Event Processor

on:
schedule:
# Close stale issues, runs every day at 1am - CloseStaleIssues
- cron: '0 1 * * *'
# Identify stale pull requests, every Friday at 5am - IdentifyStalePullRequests
- cron: '0 5 * * FRI'
# Close stale pull requests, every 6 hours at 02:30 AM, 08:30 AM, 02:30 PM and 08:30 PM - CloseStalePullRequests
- cron: '30 2,8,14,20 * * *'
# Identify stale issues, every 6 hours at 03:30 AM, 09:30 AM, 03:30 PM and 09:30 PM - IdentifyStaleIssues
- cron: '30 3,9,15,21 * * *'
# Close addressed issues, every 6 hours at 04:30 AM, 10:30 AM, 04:30 PM and 10:30 PM - CloseAddressedIssues
- cron: '30 4,10,16,22 * * *'
# Lock closed issues, every 6 hours at 05:30 AM, 11:30 AM, 05:30 PM and 11:30 PM - LockClosedIssues
- cron: '30 5,11,17,23 * * *'
# Enforce max life of issues, every Monday at 10:00 AM - EnforceMaxLifeOfIssues
# Note: GitHub uses UTC, to run at 10am PST, the cron task needs to be 6pm (1800 hours) UTC
- cron: '0 18 * * MON'
# This removes all unnecessary permissions, the ones needed will be set below.
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
permissions: {}

jobs:
event-handler:
permissions:
issues: write
pull-requests: write
name: Handle ${{ github.event.schedule }} ${{ github.event.action }} event
runs-on: ubuntu-latest
steps:
# To run github-event-processor built from source, for testing purposes, uncomment everything
# in between the Start/End-Build From Source comments and comment everything in between the
# Start/End-Install comments
# Start-Install
- name: Install GitHub Event Processor
run: >
dotnet tool install
Azure.Sdk.Tools.GitHubEventProcessor
--version 1.0.0-dev.20240229.2
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json
--global
shell: bash
# End-Install

# Testing checkout of sources from the Azure/azure-sdk-tools repository
# The ref: is the SHA from the pull request in that repository or the
# refs/pull/<PRNumber>/merge for the latest on any given PR. If the repository
# is a fork eg. <User>/azure-sdk-tools then the repository down below will
# need to point to that fork
# Start-Build
# - name: Checkout tools repo for GitHub Event Processor sources
# uses: actions/checkout@v3
# with:
# repository: Azure/azure-sdk-tools
# path: azure-sdk-tools
# ref: <refs/pull/<PRNumber>/merge> or <sha>

# - name: Build and install GitHubEventProcessor from sources
# run: |
# dotnet pack
# dotnet tool install --global --prerelease --add-source ../../../artifacts/packages/Debug Azure.Sdk.Tools.GitHubEventProcessor
# shell: bash
# working-directory: azure-sdk-tools/tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor
# End-Build

- name: Close Stale Issues Scheduled Event
if: github.event.schedule == '0 1 * * *'
run: |
cat > payload.json << 'EOF'
${{ toJson(github.event) }}
EOF
github-event-processor ${{ github.event_name }} payload.json CloseStaleIssues
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Identify Stale PullRequests Scheduled Event
if: github.event.schedule == '0 5 * * FRI'
run: |
cat > payload.json << 'EOF'
${{ toJson(github.event) }}
EOF
github-event-processor ${{ github.event_name }} payload.json IdentifyStalePullRequests
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Close Stale PullRequests Scheduled Event
if: github.event.schedule == '30 2,8,14,20 * * *'
run: |
cat > payload.json << 'EOF'
${{ toJson(github.event) }}
EOF
github-event-processor ${{ github.event_name }} payload.json CloseStalePullRequests
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Identify Stale Issues Scheduled Event
if: github.event.schedule == '30 3,9,15,21 * * *'
run: |
cat > payload.json << 'EOF'
${{ toJson(github.event) }}
EOF
github-event-processor ${{ github.event_name }} payload.json IdentifyStaleIssues
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Close Addressed Issues Scheduled Event
if: github.event.schedule == '30 4,10,16,22 * * *'
run: |
cat > payload.json << 'EOF'
${{ toJson(github.event) }}
EOF
github-event-processor ${{ github.event_name }} payload.json CloseAddressedIssues
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Lock Closed Issues Scheduled Event
if: github.event.schedule == '30 5,11,17,23 * * *'
run: |
cat > payload.json << 'EOF'
${{ toJson(github.event) }}
EOF
github-event-processor ${{ github.event_name }} payload.json LockClosedIssues
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Enforce Max Life of Issues Scheduled Event
if: github.event.schedule == '0 18 * * MON'
run: |
cat > payload.json << 'EOF'
${{ toJson(github.event) }}
EOF
github-event-processor ${{ github.event_name }} payload.json EnforceMaxLifeOfIssues
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ _testmain.go
*~
.DS_Store
.vscode
.vs
.idea

# ignore vendor/
vendor/

# environment variables
.env

# vscode
**/.vscode/*
!.vscode/cspell.json

# api view file
*.gosource

# Default Test Proxy Assets restore directory
.assets

# Default Test Proxy tools install directory
.proxy
Loading

0 comments on commit 9d13803

Please sign in to comment.