Skip to content

Commit e61db1e

Browse files
authored
chore: sync with template (#35)
1 parent 4f48487 commit e61db1e

19 files changed

+632
-229
lines changed

.coderabbit.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ language: en
77
tone_instructions: |
88
Provide feedback in a professional, friendly, constructive, and concise tone.
99
Offer clear, specific suggestions and best practices to help enhance the code quality and promote learning.
10+
Be concise and only comment on significant issues.
1011
1112
early_access: true
1213

@@ -26,21 +27,25 @@ knowledge_base:
2627
reviews:
2728
profile: chill
2829
auto_review:
29-
# Ignore reviewing if the title of the pull request contains any of these keywords (case-insensitive)
30+
# Disable incremental code review on each push
31+
auto_incremental_review: false
32+
# The keywords are case-insensitive
3033
ignore_title_keywords:
3134
- wip
3235
- draft
3336
- test
34-
# Set the commit status to 'pending' when the review is in progress and 'success' when it is complete.
3537
commit_status: false
36-
# Post review details on each review. Additionally, post a review status when a review is skipped in certain cases.
37-
review_status: false
3838
path_instructions:
3939
- path: "**/*.tf"
4040
instructions: |
4141
You're a Terraform expert who has thoroughly studied all the documentation from Hashicorp https://developer.hashicorp.com/terraform/docs and OpenTofu https://opentofu.org/docs/.
4242
You have a strong grasp of Terraform syntax and prioritize providing accurate and insightful code suggestions.
4343
As a fan of the Cloud Posse / SweetOps ecosystem, you incorporate many of their best practices https://docs.cloudposse.com/best-practices/terraform/ while balancing them with general Terraform guidelines.
44+
changed_files_summary: false
45+
poem: false
46+
# Don't post review details on each review.
47+
review_status: false
48+
sequence_diagrams: false
4449
tools:
4550
# By default, all tools are enabled.
4651
# Masterpoint uses Trunk (https://trunk.io) so we do not need a lot of this feedback due to overlap.

.editorconfig

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,8 @@ indent_style = space
77
insert_final_newline = true
88
trim_trailing_whitespace = true
99

10-
[*.{tf,tfvars}]
11-
indent_size = 2
12-
indent_style = space
13-
1410
[*.md]
1511
max_line_length = 0
16-
trim_trailing_whitespace = false
17-
18-
# Override for Makefile
19-
[{Makefile, makefile, GNUmakefile, Makefile.*}]
20-
tab_width = 2
21-
indent_style = tab
22-
indent_size = 4
2312

2413
[COMMIT_EDITMSG]
2514
max_line_length = 0

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# Order is important: the last matching pattern takes the most precedence
55

66
# These owners will be the default owners for everything
7-
* @masterpointio/masterpoint-internal
7+
* @masterpointio/masterpoint-open-source

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
## what
2-
* Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?)
3-
* Use bullet points to be concise and to the point.
2+
3+
- Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?)
4+
- Use bullet points to be concise and to the point.
45

56
## why
6-
* Provide the justifications for the changes (e.g. business case).
7-
* Describe why these changes were made (e.g. why do these commits fix the problem?)
8-
* Use bullet points to be concise and to the point.
7+
8+
- Provide the justifications for the changes (e.g. business case).
9+
- Describe why these changes were made (e.g. why do these commits fix the problem?)
10+
- Use bullet points to be concise and to the point.
911

1012
## references
11-
* Link to any supporting github issues or helpful documentation to add some context (e.g. stackoverflow).
12-
* Use `closes #123`, if this PR closes a GitHub issue `#123`
1313

14+
- Link to any supporting GitHub issues or helpful documentation to add some context (e.g. Stackoverflow).
15+
- Use `closes #123`, if this PR closes a GitHub issue `#123`

.github/renovate.json5

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"extends": [
3+
"config:best-practices",
4+
"github>aquaproj/aqua-renovate-config#2.7.5"
5+
],
6+
"schedule": [
7+
"after 9am on the first day of the month"
8+
],
9+
"assigneesFromCodeOwners": true,
10+
"dependencyDashboardAutoclose": true,
11+
"addLabels": [
12+
"auto-upgrade"
13+
],
14+
"enabledManagers": [
15+
"terraform"
16+
],
17+
"terraform": {
18+
"ignorePaths": [
19+
"**/context.tf" // Mixin file https://github.com/cloudposse/terraform-null-label/blob/main/exports/context.tf
20+
],
21+
"fileMatch": [
22+
"\\.tf$",
23+
"\\.tofu$"
24+
]
25+
},
26+
"packageRules": [
27+
{
28+
"matchDepTypes": [
29+
"optionalDependencies"
30+
],
31+
// Allow auto merge if it's not a major version update
32+
"matchUpdateTypes": [
33+
"minor",
34+
"patch",
35+
"pin",
36+
"digest"
37+
],
38+
"automerge": true
39+
},
40+
{
41+
"matchFileNames": ["**/*.tofu", "**/*.tf"],
42+
"matchDatasources": ["terraform-provider", "terraform-module"],
43+
"registryUrls": ["https://registry.opentofu.org"]
44+
},
45+
{
46+
"matchFileNames": ["**/*.tofu"],
47+
"matchDepTypes": ["required_version"],
48+
"registryUrls": ["https://registry.opentofu.org"]
49+
},
50+
{
51+
"matchFileNames": ["**/*.tf"],
52+
"matchDepTypes": ["required_version"],
53+
"registryUrls": ["https://registry.terraform.io"]
54+
}
55+
]
56+
}

.github/workflows/lint.yaml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
name: Lint
22

3-
concurrency:
4-
group: lint-${{ github.head_ref || github.run_id }}
5-
cancel-in-progress: true
6-
73
on: pull_request
84

95
permissions:
@@ -13,17 +9,10 @@ permissions:
139
pull-requests: read
1410

1511
jobs:
16-
trunk-check:
12+
lint:
1713
runs-on: ubuntu-latest
1814
steps:
1915
- name: Check out Git repository
20-
uses: actions/checkout@v4
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
2117
- name: Trunk Check
22-
uses: trunk-io/trunk-action@4d5ecc89b2691705fd08c747c78652d2fc806a94 # v1.1.19
23-
24-
conventional-title:
25-
runs-on: ubuntu-latest
26-
steps:
27-
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
uses: trunk-io/trunk-action@4d5ecc89b2691705fd08c747c78652d2fc806a94 #v1.1.19

.github/workflows/release-please.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ on:
88
permissions:
99
contents: write
1010
pull-requests: write
11+
issues: write
1112

1213
jobs:
1314
release-please:
1415
runs-on: ubuntu-latest
1516
steps:
16-
- uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4.1.3
17+
- uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f #v4.1.3
1718
with:
1819
release-type: terraform-module

.github/workflows/test.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: TF Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
actions: read
11+
checks: write
12+
contents: read
13+
id-token: write
14+
pull-requests: read
15+
16+
env:
17+
AWS_REGION: us-east-1
18+
19+
jobs:
20+
tf-test:
21+
name: 🧪 ${{ matrix.tf }} test
22+
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
tf: [tofu, terraform]
26+
steps:
27+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
29+
- name: Aqua Cache
30+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
31+
if: ${{ !github.event.act }} # Don't enable the cache step if we're using act for testing
32+
with:
33+
path: ~/.local/share/aquaproj-aqua
34+
key: v1-aqua-installer-${{runner.os}}-${{runner.arch}}-${{hashFiles('aqua.yaml')}}
35+
restore-keys: |
36+
v1-aqua-installer-${{runner.os}}-${{runner.arch}}-
37+
38+
- name: Install Aqua
39+
uses: aquaproj/aqua-installer@5e54e5cee8a95ee2ce7c04cb993da6dfad13e59c # v3.2.1
40+
with:
41+
aqua_version: v2.48.1
42+
43+
- name: Aqua Install
44+
shell: bash
45+
run: aqua install --tags ${{ matrix.tf }}
46+
47+
- name: Check if TF AWS provider is used
48+
id: check_aws_provider
49+
run: |
50+
if grep -q "aws" $(find . -name "versions.tf" -o -name "versions.tofu" -type f); then
51+
echo "Found aws in versions.tf or versions.tofu files"
52+
echo "contains_hashicorp=true" >> $GITHUB_OUTPUT
53+
else
54+
echo "No versions.tf or versions.tofu files contain aws"
55+
echo "contains_hashicorp=false" >> $GITHUB_OUTPUT
56+
fi
57+
58+
# Assume into the `masterpoint-testing` AWS account with OIDC for testing ONLY if the AWS provider is used
59+
# Not needed for modules that don't use the AWS provider, for example, exclusive Spacelift modules
60+
- name: Configure AWS Credentials on `masterpoint-testing` AWS Account
61+
if: steps.check_aws_provider.outputs.contains_hashicorp == 'true'
62+
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
63+
with:
64+
role-to-assume: arn:aws:iam::115843287071:role/mp-ue1-testing-oidc-github
65+
role-session-name: GitHubActionsOIDC-MP-Infra-Repo
66+
aws-region: ${{ env.AWS_REGION }}
67+
68+
- run: ${{ matrix.tf }} init
69+
- run: ${{ matrix.tf }} test

.github/workflows/trunk-upgrade.yaml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
1-
name: Monthly Trunk Upgrade
1+
name: Trunk Upgrade
2+
23
on:
34
schedule:
45
# On the first day of every month @ 8am
56
- cron: 0 8 1 * *
6-
# Allows us to manually run the workflow from Actions UI
77
workflow_dispatch: {}
8+
89
permissions: read-all
10+
911
jobs:
10-
trunk_upgrade:
11-
name: Upgrade Trunk
12+
trunk-upgrade:
1213
runs-on: ubuntu-latest
1314
permissions:
14-
contents: write # For trunk to create PRs
15-
pull-requests: write # For trunk to create PRs
15+
# For trunk to create PRs
16+
contents: write
17+
pull-requests: write
1618
steps:
1719
- name: Checkout
18-
uses: actions/checkout@v4
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
22+
- name: Create Token for MasterpointBot App
23+
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a #v2.1.0
24+
id: generate-token
25+
with:
26+
app_id: ${{ secrets.MP_BOT_APP_ID }}
27+
private_key: ${{ secrets.MP_BOT_APP_PRIVATE_KEY }}
1928

20-
- name: Trunk Upgrade
29+
- name: Upgrade
2130
uses: trunk-io/trunk-action/upgrade@4d5ecc89b2691705fd08c747c78652d2fc806a94 # v1.1.19
2231
with:
23-
base: main
32+
github-token: ${{ steps.generate-token.outputs.token }}
2433
reviewers: "@masterpointio/masterpoint-internal"
2534
prefix: "chore: "

.gitignore

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,46 @@
1-
# Local .terraform directories
2-
**/.terraform/*
1+
# Ignore override files as they are usually used to override resources locally
2+
*override.tf
3+
*override.tf.json
34

45
# .tfstate files
56
*.tfstate
67
*.tfstate.*
78

8-
# Crash log files
9-
crash.log
10-
11-
# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
12-
# .tfvars files are managed as part of configuration and so should be included in
13-
# version control.
14-
#
15-
# example.tfvars
16-
17-
# Ignore override files as they are usually used to override resources locally and so
18-
# are not checked in
19-
override.tf
20-
override.tf.json
21-
*_override.tf
22-
*_override.tf.json
23-
24-
# Include override files you do wish to add to version control using negated pattern
25-
#
26-
# !example_override.tf
27-
28-
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
29-
# example: *tfplan*
30-
*.plan
31-
32-
# Ignore IntelliJ configuration
33-
/.idea/
9+
# Local .terraform directories
10+
**/.terraform/*
3411

35-
# Ignore lock files
12+
# Ignore the root .terraform.lock.hcl file (Child modules don't want this)
3613
.terraform.lock.hcl
37-
38-
# Random
39-
*.DS_Store
14+
!examples/**/.terraform.lock.hcl
15+
16+
# IDE/Editor settings
17+
**/.idea
18+
**/*.iml
19+
.vscode/
20+
*.orig
21+
*.draft
22+
*~
23+
24+
# Build Harness https://github.com/cloudposse/build-harness
25+
**/.build-harness
26+
**/build-harness
27+
28+
# Log files
29+
*.log
30+
31+
# Output from other tools that might be used alongside Terraform/OpenTofu
32+
*.tfvars.json
33+
backend.tf.json
34+
35+
# Taskit files
36+
.taskit/
37+
.task/
38+
.env.taskit-secrets
39+
40+
# Other
41+
**/*.backup
42+
***/*.tmp
43+
**/*.temp
44+
**/*.bak
45+
**/*.*swp
46+
**/.DS_Store

.pre-commit-config.yaml

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

0 commit comments

Comments
 (0)