Skip to content

Commit a5f6718

Browse files
committed
2 parents 044a89d + 6235f5a commit a5f6718

Some content is hidden

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

57 files changed

+1584
-724
lines changed
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: Bug Report
2+
description: If something isn't working as expected.
3+
labels: [bug]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thank you for taking the time to fill out a bug report.
9+
10+
If you are not running the latest version of this module, please try to reproduce your bug with the latest version before opening an issue.
11+
- type: checkboxes
12+
attributes:
13+
label: Is there an existing issue for this?
14+
description: Please search to see if an issue already exists for the bug you encountered.
15+
options:
16+
- label: I have searched the existing issues
17+
required: true
18+
- type: dropdown
19+
attributes:
20+
label: Greenfield/Brownfield provisioning
21+
description: Do you reproduce the bug with a new infrastructure provisioning (greenfield) or you need an existing infrastructure with an existing terraform state (brownfield) to reproduce the bug ?
22+
multiple: false
23+
options:
24+
- greenfield
25+
- brownfield
26+
validations:
27+
required: true
28+
- type: input
29+
id: terraform
30+
attributes:
31+
label: Terraform Version
32+
description: Which Terraform version are you using?
33+
placeholder: Example value, 1.2.8
34+
validations:
35+
required: true
36+
- type: input
37+
id: module
38+
attributes:
39+
label: Module Version
40+
description: Which module version are you using?
41+
placeholder: Example value, 6.0.0
42+
validations:
43+
required: true
44+
- type: input
45+
id: azurerm
46+
attributes:
47+
label: AzureRM Provider Version
48+
description: Which AzureRM Provider version are you using?
49+
placeholder: Example value, 3.21.1
50+
validations:
51+
required: true
52+
- type: input
53+
id: resource
54+
attributes:
55+
label: Affected Resource(s)/Data Source(s)
56+
description: Please list the affected resources and/or data sources.
57+
placeholder: azurerm_XXXXX
58+
validations:
59+
required: true
60+
- type: textarea
61+
id: config
62+
attributes:
63+
label: Terraform Configuration Files
64+
description: |
65+
Please provide a minimal Terraform configuration that can reproduce the issue.
66+
render: hcl
67+
validations:
68+
required: true
69+
- type: textarea
70+
id: tfvars
71+
attributes:
72+
label: tfvars variables values
73+
description: |
74+
Please provide the necessary tfvars variables values to reproduce the issue. Do not share secrets or sensitive information.
75+
render: hcl
76+
validations:
77+
required: true
78+
- type: textarea
79+
id: debug
80+
attributes:
81+
label: Debug Output/Panic Output
82+
description: |
83+
For long debug logs please provide a link to a GitHub Gist containing the complete debug output. Please do NOT paste the debug output in the issue; just paste a link to the Gist.
84+
85+
To obtain the debug output, see the [Terraform documentation on debugging](https://www.terraform.io/docs/internals/debugging.html).
86+
render: shell
87+
validations:
88+
required: true
89+
- type: textarea
90+
id: expected
91+
attributes:
92+
label: Expected Behaviour
93+
description: What should have happened?
94+
- type: textarea
95+
id: actual
96+
attributes:
97+
label: Actual Behaviour
98+
description: What actually happened?
99+
- type: textarea
100+
id: reproduce
101+
attributes:
102+
label: Steps to Reproduce
103+
description: |
104+
Please list the steps required to reproduce the issue, e.g.
105+
106+
1. `terraform apply`
107+
- type: input
108+
id: facts
109+
attributes:
110+
label: Important Factoids
111+
description: |
112+
Are there anything atypical about your accounts that we should know? For example: Running in a Azure China/Germany/Government?
113+
- type: textarea
114+
id: references
115+
attributes:
116+
label: References
117+
description: |
118+
Information about referencing Github Issues: https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests
119+
120+
Are there any other GitHub issues (open or closed) or pull requests that should be linked here? Such as vendor documentation?
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Feature Request
2+
description: I have a suggestion (and might want to implement myself)!
3+
title: "Support for [thing]"
4+
body:
5+
- type: checkboxes
6+
attributes:
7+
label: Is there an existing issue for this?
8+
description: Please search to see if an issue already exists for the feature you are requesting.
9+
options:
10+
- label: I have searched the existing issues
11+
required: true
12+
- type: textarea
13+
id: description
14+
attributes:
15+
label: Description
16+
description: Please leave a helpful description of the feature request here.
17+
validations:
18+
required: true
19+
- type: input
20+
id: resource
21+
attributes:
22+
label: New or Affected Resource(s)/Data Source(s)
23+
description: Please list the new or affected resources and/or data sources.
24+
placeholder: azurerm_XXXXX
25+
validations:
26+
required: true
27+
- type: textarea
28+
id: config
29+
attributes:
30+
label: Potential Terraform Configuration
31+
description: Please provide an example of what the enhancement could look like on this Terraform module.
32+
render: hcl
33+
- type: textarea
34+
id: references
35+
attributes:
36+
label: References
37+
description: |
38+
Information about referencing Github Issues: https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests
39+
40+
Are there any other GitHub issues (open or closed) or pull requests that should be linked here? Vendor blog posts or documentation? For example:
41+
42+
* https://azure.microsoft.com/en-us/roadmap/virtual-network-service-endpoint-for-azure-cosmos-db/

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/test"
5+
schedule:
6+
interval: "weekly"

.github/pull_request_template.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
<!---
2-
Please add this into the test of test/fixture, format the changes by "terraform fmt", and test it by run the following:
3-
```sh
4-
$ docker build --build-arg BUILD_ARM_SUBSCRIPTION_ID=$ARM_SUBSCRIPTION_ID --build-arg BUILD_ARM_CLIENT_ID=$ARM_CLIENT_ID --build-arg BUILD_ARM_CLIENT_SECRET=$ARM_CLIENT_SECRET --build-arg BUILD_ARM_TENANT_ID=$ARM_TENANT_ID -t azure-vnet .
5-
$ docker run --rm azure-vnet /bin/bash -c "bundle install && rake full"
6-
```
7-
Please add this into the example usage of README.md and format the changes by "terrafmt fmt README.md". Please intall "terrafmt" by [install terrafmt](https://github.com/katbyte/terrafmt#install).
8-
--->
1+
## Describe your changes
92

10-
Fixes #000
3+
## Issue number
114

12-
Changes proposed in the pull request:
5+
#000
136

7+
## Checklist before requesting a review
8+
- [ ] The pr title can be used to describe what this pr did in `CHANGELOG.md` file
9+
- [ ] I have executed pre-commit on my machine
10+
- [ ] I have passed pr-check on my machine
11+
12+
Thanks for your cooperation!
1413

.github/workflows/acc-test.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: E2E Test
2+
on:
3+
pull_request:
4+
types: [ 'opened', 'synchronize' ]
5+
paths:
6+
- '.github/**'
7+
- '**.go'
8+
- '**.tf'
9+
- '.github/workflows/**'
10+
- '**.md'
11+
- '**/go.mod'
12+
13+
jobs:
14+
runner-select:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
runner: ${{ steps.runner.outputs.runner }}
18+
steps:
19+
- id: runner
20+
run: echo "runner=[self-hosted, 1ES.Pool=${{ github.event.repository.name }}]" >> $GITHUB_OUTPUT
21+
acc-tests:
22+
needs: [runner-select]
23+
runs-on: ${{ needs.runner-select.outputs.runner }}
24+
environment:
25+
name: acctests
26+
steps:
27+
- uses: actions/checkout@v3
28+
- name: e2e test
29+
run: |
30+
az login --identity --username $MSI_ID > /dev/null
31+
export ARM_SUBSCRIPTION_ID=$(az login --identity --username $MSI_ID | jq -r '.[0] | .id')
32+
export ARM_TENANT_ID=$(az login --identity --username $MSI_ID | jq -r '.[0] | .tenantId')
33+
docker run --rm -v $(pwd):/src -w /src --network=host -e MSI_ID -e ARM_SUBSCRIPTION_ID -e ARM_TENANT_ID -e ARM_USE_MSI=true mcr.microsoft.com/azterraform:latest make e2e-test
34+
- name: version-upgrade test
35+
run: |
36+
az login --identity --username $MSI_ID > /dev/null
37+
export ARM_SUBSCRIPTION_ID=$(az login --identity --username $MSI_ID | jq -r '.[0] | .id')
38+
export ARM_TENANT_ID=$(az login --identity --username $MSI_ID | jq -r '.[0] | .tenantId')
39+
docker run --rm -v $(pwd):/src -w /src --network=host -e MSI_ID -e ARM_SUBSCRIPTION_ID -e ARM_TENANT_ID -e ARM_USE_MSI=true mcr.microsoft.com/azterraform:latest make version-upgrade-test
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: 'Comment on PR'
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Pre Pull Request Check"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
comment:
11+
name: 'breaking change detect'
12+
runs-on: ubuntu-latest
13+
if: ${{ github.event.workflow_run.event == 'pull_request' }}
14+
steps:
15+
- name: 'Download change artifact'
16+
uses: dawidd6/action-download-artifact@v2
17+
with:
18+
github_token: "${{ secrets.GITHUB_TOKEN }}"
19+
run_id: ${{ github.event.workflow_run.id }}
20+
workflow: pr-check.yaml
21+
name: change
22+
if_no_artifact_found: ignore
23+
- name: Check change existence
24+
id: check_change
25+
uses: andstor/file-existence-action@v1
26+
with:
27+
files: "change"
28+
- name: 'Comment on PR'
29+
if: steps.check_change.outputs.files_exists == 'true'
30+
run: |
31+
export PR_NUMBER=$(cat change | jq -r '.pr')
32+
msg=$(cat change | jq -r '.body')
33+
jq -n --arg msg "$msg" '{body: $msg}' > body.txt
34+
curl -s -X POST -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/comments -d @body.txt

.github/workflows/pr-check.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Pre Pull Request Check
2+
on:
3+
pull_request:
4+
types: ['opened', 'synchronize']
5+
paths:
6+
- '.github/**'
7+
- '**.go'
8+
- '**.tf'
9+
- '.github/workflows/**'
10+
- '**.md'
11+
- '**/go.mod'
12+
13+
jobs:
14+
prepr-check:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: checkout
18+
uses: actions/checkout@v3
19+
- name: pr-check
20+
run: |
21+
docker run --rm -v $(pwd):/src -w /src -e SKIP_CHECKOV mcr.microsoft.com/azterraform:latest make pr-check
22+
- name: Set up Go
23+
uses: actions/setup-go@v3
24+
with:
25+
go-version: 1.19
26+
- name: Initialize CodeQL
27+
uses: github/codeql-action/init@v2
28+
with:
29+
languages: go
30+
- name: build-test
31+
run: |
32+
make build-test
33+
- name: Perform CodeQL Analysis
34+
uses: github/codeql-action/analyze@v2
35+
- name: Breaking Change Brief
36+
run: |
37+
c=$(docker run --rm -t -v $(pwd):/src -w /src mcr.microsoft.com/azterraform:latest breaking_detect /src ${{ github.repository_owner }} ${{ github.event.repository.name }} ${{ github.base_ref }})
38+
if [ ! -z "$c" ]; then
39+
msg=$(printf "Potential Breaking Changes in ${{ github.event.pull_request.head.sha }}:\n${c}")
40+
jq -n --arg msg "$msg" '{pr: ${{ github.event.pull_request.number }}, body: $msg}' > change
41+
fi
42+
- name: Check change existence
43+
id: check_change
44+
uses: andstor/file-existence-action@v1
45+
with:
46+
files: "change"
47+
- name: 'Upload breaking change warning'
48+
if: steps.check_change.outputs.files_exists == 'true'
49+
uses: actions/upload-artifact@v2
50+
with:
51+
retention-days: 1
52+
name: change
53+
path: change
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Update Changelog
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- master
7+
tags:
8+
- '*'
9+
10+
jobs:
11+
update-changelog:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: get-default-branch
15+
run: |
16+
branch=$(curl -s "https://api.github.com/repos/$GITHUB_REPOSITORY" | jq -r '.default_branch')
17+
echo "default_branch=$branch" >> $GITHUB_ENV
18+
- name: checkout
19+
uses: actions/checkout@v3
20+
with:
21+
ref: ${{ env.default_branch }}
22+
- name: update-changelog
23+
run: |
24+
MAJOR_VERSION=$(ls | grep CHANGELOG | cut -d'-' -f 2 | cut -f 1 -d '.' | grep v | sort -V -r | head -n 1)
25+
if [ -z "$MAJOR_VERSION" ]; then
26+
MAJOR_VERSION=0
27+
else
28+
MAJOR_VERSION=${MAJOR_VERSION#"v"}
29+
MAJOR_VERSION=$((MAJOR_VERSION+1))
30+
fi
31+
32+
previous_tag=$(docker run -e MAJOR_VERSION=$MAJOR_VERSION --rm mcr.microsoft.com/azterraform:latest previousTag ${{ github.repository_owner }} ${{ github.event.repository.name }} $MAJOR_VERSION.0.0)
33+
if [ -z $previous_tag ]; then
34+
docker run --rm -v $(pwd):/src -w /src githubchangeloggenerator/github-changelog-generator -u ${{ github.repository_owner }} -p ${{ github.event.repository.name }} -t ${{ secrets.GITHUB_TOKEN }} --no-issues --no-compare-link
35+
else
36+
docker run --rm -v $(pwd):/src -w /src githubchangeloggenerator/github-changelog-generator -u ${{ github.repository_owner }} -p ${{ github.event.repository.name }} -t ${{ secrets.GITHUB_TOKEN }} --no-issues --no-compare-link --since-tag=$previous_tag
37+
fi
38+
sudo chmod -R ugo+rwX .
39+
- name: Commit & Push changes
40+
uses: actions-js/push@master
41+
with:
42+
github_token: ${{ secrets.GITHUB_TOKEN }}
43+
message: 'Update changelog'
44+
branch: ${{ env.default_branch }}

0 commit comments

Comments
 (0)