Skip to content

Commit 5737b40

Browse files
committed
Merge branch 'main' into aks-automatic
2 parents 5b58fd1 + 5dcf200 commit 5737b40

File tree

1,513 files changed

+45984
-41024
lines changed

Some content is hidden

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

1,513 files changed

+45984
-41024
lines changed

.github/labeler-issue-triage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,4 +357,4 @@ service/vmware:
357357
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_(vmware_cluster\W+|vmware_express_route_authorization\W+|vmware_netapp_volume_attachment\W+|vmware_private_cloud\W+|voice_services_communications_gateway\W+|voice_services_communications_gateway_test_line\W+)((.|\n)*)###'
358358

359359
service/workloads:
360-
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_(chaos_studio_|container_connected_registry\W+|container_registry_cache_rule\W+|container_registry_credential_set\W+|container_registry_task\W+|container_registry_task_schedule_run_now\W+|container_registry_token_password\W+|kubernetes_cluster_automatic\W+|kubernetes_cluster_extension\W+|kubernetes_cluster_trusted_access_role_binding\W+|kubernetes_fleet_manager\W+|kubernetes_fleet_member\W+|kubernetes_fleet_update_run\W+|kubernetes_fleet_update_strategy\W+|kubernetes_flux_configuration\W+|kubernetes_node_pool_snapshot\W+|workloads_sap_)((.|\n)*)###'
360+
- '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_(chaos_studio_|container_connected_registry\W+|container_registry_cache_rule\W+|container_registry_credential_set\W+|container_registry_task\W+|container_registry_task_schedule_run_now\W+|container_registry_token_password\W+|kubernetes_cluster_automatic\W+|kubernetes_cluster_deployment_safeguard\W+|kubernetes_cluster_extension\W+|kubernetes_cluster_trusted_access_role_binding\W+|kubernetes_fleet_manager\W+|kubernetes_fleet_member\W+|kubernetes_fleet_update_run\W+|kubernetes_fleet_update_strategy\W+|kubernetes_flux_configuration\W+|kubernetes_node_pool_snapshot\W+|workloads_sap_)((.|\n)*)###'

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
- set-product-version
125125
runs-on: custom-ubuntu-22.04-medium
126126
if: github.repository_owner == 'hashicorp'
127-
timeout-minutes: 10
127+
timeout-minutes: 30
128128
strategy:
129129
fail-fast: true
130130
# Verify expected Artifacts list for a workflow run.

.github/workflows/comment-failure.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
# This file is reused, and called from other workflows
55
workflow_call:
66

7+
permissions:
8+
pull-requests: write
9+
710
jobs:
811
comment-failure:
912
runs-on: ubuntu-latest

.github/workflows/depscheck.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Vendor Dependencies Check
33

44
permissions:
55
contents: read
6+
pull-requests: write
67

78
on:
89
pull_request:

.github/workflows/gencheck.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Generation Check
33

44
permissions:
55
contents: read
6+
pull-requests: write
67

78
on:
89
pull_request:

.github/workflows/golint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: GoLang Linting
33

44
permissions:
55
contents: read
6+
pull-requests: write
67

78
on:
89
pull_request:

.github/workflows/gradually-deprecated.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Check for new usages of deprecated functionality
33

44
permissions:
55
contents: read
6+
pull-requests: write
67

78
on:
89
pull_request:

.github/workflows/provider-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
permissions:
1313
contents: read
1414
id-token: write
15-
pull-requests: read
15+
pull-requests: write
1616

1717
jobs:
1818
secrets-check:
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
---
2+
name: Run TeamCity Tests on Comment
3+
4+
on:
5+
issue_comment:
6+
types: [created]
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
issues: write
12+
13+
jobs:
14+
check-team-membership:
15+
runs-on: ubuntu-latest
16+
# Only run on pull request comments that starts with /test
17+
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/test')
18+
outputs:
19+
is-team-member: ${{ steps.check-membership.outputs.is-member }}
20+
env:
21+
AUTHORIZED_TEAM: terraform-azure
22+
steps:
23+
- name: Check team membership
24+
id: check-membership
25+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
26+
with:
27+
github-token: ${{ secrets.GH_MEMEBERSHIP_CHECK_TOKEN }}
28+
script: |
29+
const teamSlug = "${{ env.AUTHORIZED_TEAM }}";
30+
const org = context.repo.owner;
31+
const username = context.actor;
32+
33+
try {
34+
const response = await github.rest.teams.getMembershipForUserInOrg({
35+
org: org,
36+
team_slug: teamSlug,
37+
username: username,
38+
});
39+
40+
const isMember = response.data.state === 'active';
41+
core.setOutput('is-member', isMember);
42+
43+
if (isMember) {
44+
core.info(`User ${username} is a member of team ${teamSlug}`);
45+
} else {
46+
core.warning(`User ${username} is not an active member of team ${teamSlug}`);
47+
}
48+
49+
return isMember;
50+
} catch (error) {
51+
if (error.status === 404) {
52+
core.warning(`User ${username} is not a member of team ${teamSlug}`);
53+
core.setOutput('is-member', false);
54+
return false;
55+
}
56+
throw error;
57+
}
58+
59+
run-tests:
60+
runs-on: ubuntu-latest
61+
needs: check-team-membership
62+
if: needs.check-team-membership.outputs.is-team-member == 'true'
63+
env:
64+
TCTEST_SERVER: ${{ secrets.TCTEST_SERVER }}
65+
TCTEST_FILEREGEX: 'internal/services/[a-z]*/[_a-zA-Z]*(resource|data_source)'
66+
TCTEST_SKIP_QUEUE: 'true'
67+
TCTEST_TOKEN_TC: ${{ secrets.TCTEST_TOKEN_TC }}
68+
TCTEST_BUILDTYPEID: TF_AzureRM_AZURERM_SERVICE_PUBLIC
69+
TCTEST_REPO: terraform-providers/terraform-provider-azurerm
70+
steps:
71+
- name: Setup Go
72+
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.2.0
73+
with:
74+
go-version: '1.25'
75+
76+
- name: Get tctest version
77+
id: tctest-version
78+
run: |
79+
LATEST_RELEASE=$(curl -s https://api.github.com/repos/katbyte/tctest/releases/latest | grep "tag_name" | cut -d '"' -f 4)
80+
echo "version=${LATEST_RELEASE}" >> $GITHUB_OUTPUT
81+
echo "Latest tctest release: $LATEST_RELEASE"
82+
83+
- name: Cache tctest binary
84+
id: cache-tctest
85+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
86+
with:
87+
path: ~/go/bin/tctest
88+
key: tctest-${{ runner.os }}-${{ steps.tctest-version.outputs.version }}
89+
90+
- name: Install tctest
91+
if: steps.cache-tctest.outputs.cache-hit != 'true'
92+
run: |
93+
go install github.com/katbyte/tctest@latest
94+
95+
- name: Run tctest
96+
run: |
97+
PR_NUMBER=${{ github.event.issue.number }}
98+
COMMENT_BODY="${{ github.event.comment.body }}"
99+
echo "Running tctest for PR #${PR_NUMBER}"
100+
tctest pr ${PR_NUMBER} --properties "POST_GITHUB_COMMENT=true"
101+
102+
- name: Comment on success
103+
if: success()
104+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
105+
with:
106+
github-token: ${{ secrets.GITHUB_TOKEN }}
107+
script: |
108+
await github.rest.reactions.createForIssueComment({
109+
owner: context.repo.owner,
110+
repo: context.repo.repo,
111+
comment_id: context.payload.comment.id,
112+
content: 'rocket'
113+
});
114+
115+
- name: Comment on failure
116+
if: failure()
117+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
118+
with:
119+
github-token: ${{ secrets.GITHUB_TOKEN }}
120+
script: |
121+
await github.rest.issues.createComment({
122+
owner: context.repo.owner,
123+
repo: context.repo.repo,
124+
issue_number: context.issue.number,
125+
body: '❌ Failed to trigger TeamCity tests. Please check the workflow logs for details.'
126+
});
127+
128+
unauthorized-comment:
129+
runs-on: ubuntu-latest
130+
needs: check-team-membership
131+
if: needs.check-team-membership.outputs.is-team-member == 'false'
132+
steps:
133+
- name: Comment unauthorized
134+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
135+
with:
136+
github-token: ${{ secrets.GITHUB_TOKEN }}
137+
script: |
138+
await github.rest.issues.createComment({
139+
owner: context.repo.owner,
140+
repo: context.repo.repo,
141+
issue_number: context.issue.number,
142+
body: '⚠️ You are not authorized to run tests. Only members of the designated team can trigger test runs.'
143+
});

.github/workflows/shellcheck.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: ShellCheck Scripts
33

44
permissions:
55
contents: read
6+
pull-requests: write
67

78
on:
89
pull_request:

0 commit comments

Comments
 (0)