Skip to content

Commit 8e79f8e

Browse files
authored
Merge pull request #1 from ultimateai/PLT-356
major: PLT-356 Rolling out workload identity k8s
2 parents ae79681 + 6fe41c8 commit 8e79f8e

21 files changed

+795
-361
lines changed

.github/workflows/PULL_REQUEST_TEMPLATE.md

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

.github/workflows/stale.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: "Close stale issues"
16+
on:
17+
schedule:
18+
- cron: "0 23 * * *"
19+
20+
jobs:
21+
stale:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/stale@v7
25+
with:
26+
repo-token: ${{ secrets.ULTIMATE_GITHUB_PAT }}
27+
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days'
28+
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days'
29+
exempt-issue-labels: triaged

.github/workflows/terraform.yml

Lines changed: 8 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -7,70 +7,17 @@ on:
77
pull_request:
88

99
jobs:
10-
terraform:
11-
name: "Terraform"
10+
check_format:
1211
runs-on: ubuntu-latest
12+
name: Check terraform file are formatted correctly
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v2
1616

17-
- name: Setup Terraform
18-
uses: hashicorp/setup-terraform@v1
19-
with:
20-
terraform_version: 0.15.5
21-
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
17+
- name: terraform fmt
18+
uses: dflook/terraform-fmt-check@v1
19+
id: fmt-check
2220

23-
- name: Terraform Format
24-
id: fmt
25-
run: terraform fmt -check
26-
27-
- name: Terraform Init
28-
id: init
29-
run: terraform init
30-
31-
- name: Terraform Validate
32-
id: validate
33-
run: terraform validate -no-color
34-
35-
- name: Terraform Plan
36-
id: plan
37-
if: github.event_name == 'pull_request'
38-
run: terraform plan -no-color
39-
continue-on-error: true
40-
41-
- uses: actions/github-script@v4
42-
if: github.event_name == 'pull_request'
43-
env:
44-
PLAN: "terraform\n${{ steps.plan.outputs.stdout }}"
45-
with:
46-
github-token: ${{ secrets.GITHUB_TOKEN }}
47-
script: |
48-
const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\`
49-
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
50-
#### Terraform Validation 🤖\`${{ steps.validate.outputs.stdout }}\`
51-
#### Terraform Plan 📖\`${{ steps.plan.outcome }}\`
52-
53-
<details><summary>Show Plan</summary>
54-
55-
\`\`\`\n
56-
${process.env.PLAN}
57-
\`\`\`
58-
59-
</details>
60-
61-
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
62-
63-
github.issues.createComment({
64-
issue_number: context.issue.number,
65-
owner: context.repo.owner,
66-
repo: context.repo.repo,
67-
body: output
68-
})
69-
70-
- name: Terraform Plan Status
71-
if: steps.plan.outcome == 'failure'
72-
run: exit 1
73-
74-
- name: Terraform Apply
75-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
76-
run: terraform apply -auto-approve
21+
- name: Wrong formatting found
22+
if: ${{ failure() && steps.fmt-check.outputs.failure-reason == 'check-failed' }}
23+
run: echo "terraform formatting check failed"

.pre-commit-config.yaml

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,17 @@
1-
fail_fast: false
21
repos:
3-
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v2.3.0
2+
- repo: https://github.com/mineiros-io/pre-commit-hooks
3+
rev: v0.4.1
54
hooks:
6-
- id: check-yaml
7-
- id: end-of-file-fixer
8-
exclude: README.md
9-
- id: trailing-whitespace
10-
exclude: README.md
11-
- id: detect-aws-credentials
12-
- id: detect-private-key
13-
- repo: local
14-
hooks:
15-
- id: terraform_lint
16-
name: Terraform lint
17-
entry: make lint
18-
language: system
19-
- id: terraform_fmt
20-
name: Terraform format
21-
entry: make fmt
22-
language: system
23-
- id: terraform_validate
24-
name: Terraform validate
25-
entry: make validate
26-
language: system
27-
- id: terraform_sec
28-
name: Terraform security
29-
entry: make security
30-
language: system
31-
- id: terraform_checkov
32-
name: Terraform static code analysis tool
33-
entry: make checkov
34-
language: system
35-
- id: terraform_docs
36-
name: Terraform documentation
37-
entry: make docs
38-
language: system
5+
- id: terraform-fmt
6+
- id: terraform-validate
7+
exclude: ^examples|.terraform/
8+
- id: tflint
9+
- id: phony-targets
10+
- id: terradoc-validate
11+
- id: golangci-lint
12+
- id: terradoc-fmt
13+
- id: terradoc-generate
14+
# - id: terramate-generate
15+
- id: markdown-link-check
16+
args: ['-p'] # When adding the -p flag, markdown-link-check will always with an exit code 0, even if dead links are found
17+
verbose: true # Forces the output of the hook to be printed even when the hook passes.

.terraform-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Terraform docs configuration file
22
formatter: markdown table
3-
header-from: doc.md
3+
header-from: Terraform-docs.md
44
sort:
55
enabled: true
66
sections:

.terraform.lock.hcl

Lines changed: 59 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @ultimateai/platform-engineering

CONTRIBUTING.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Contribution Guidelines
2+
3+
First and foremost, we’d like to express our gratitude to you for taking the time to contribute.
4+
We welcome and appreciate any and all contributions via
5+
[Pull Requests] along the [GitHub Flow].
6+
7+
- [Contribution Guidelines](#contribution-guidelines)
8+
- [Open a GitHub issue](#open-a-github-issue)
9+
- [Fork the repository on GitHub](#fork-the-repository-on-github)
10+
- [Install the pre-commit hooks](#install-the-pre-commit-hooks)
11+
- [Update the documentation](#update-the-documentation)
12+
- [Update the tests](#update-the-tests)
13+
- [Update the code](#update-the-code)
14+
- [Create a pull request](#create-a-pull-request)
15+
- [Merge and release](#merge-and-release)
16+
17+
## Open a GitHub issue
18+
19+
For bug reports or requests, please submit your issue in the appropriate repository.
20+
21+
We advise that you open an issue and ask the
22+
[CODEOWNERS] and community prior to starting a contribution.
23+
This is your chance to ask questions and receive feedback before
24+
writing (potentially wrong) code. We value the direct contact with our community
25+
a lot, so don't hesitate to ask any questions.
26+
27+
## Fork the repository on GitHub
28+
29+
[Fork] the repository into your own GitHub account and [create a new branch] as
30+
described in the [GitHub Flow].
31+
32+
## Install the pre-commit hooks
33+
34+
If the repository you're working on ships with a
35+
[`.pre-commit-config.yaml`][pre-commit-file],
36+
make sure the necessary hooks have been installed before you begin working
37+
(e.g. a `pre-commit install`).
38+
39+
## Update the documentation
40+
41+
We encourage you to update the documentation before writing any code (please see
42+
[Readme Driven Development]. This ensures the
43+
documentation stays up to date and allows you to think through the problem fully before you begin implementing any
44+
changes.
45+
46+
## Update the tests
47+
48+
We also recommend updating the automated tests before updating any code
49+
(see [Test Driven Development](https://en.wikipedia.org/wiki/Test-driven_development)).
50+
51+
That means that you should add or update a test case, run all tests and verify
52+
that the new test fails with a clear error message and then start implementing
53+
the code changes to get that test to pass.
54+
55+
The test folder in every repository will have documentation on how to run the
56+
tests locally.
57+
58+
## Update the code
59+
60+
At this point, make your code changes and constantly test again your new test case to make sure that everything working
61+
properly. Do [commit] early and often and make useful commit messages.
62+
63+
If a backwards incompatible change cannot be avoided, please make sure to call that out when you submit a pull request,
64+
explaining why the change is absolutely necessary.
65+
66+
## Create a pull request
67+
68+
[Create a pull request] with your changes.
69+
Please make sure to include the following:
70+
71+
1. A description of the change, including a link to your GitHub issue.
72+
1. Any notes on backwards incompatibility or downtime.
73+
74+
## Merge and release
75+
76+
The [CODEOWNERS] of the repository will review your code and provide feedback.
77+
If everything looks good, they will merge the code and release a new version while following the principles of [Semantic Versioning (SemVer)].
78+
79+
<!-- References -->
80+
81+
[github flow]: https://guides.github.com/introduction/flow/
82+
[codeowners]: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
83+
[fork]: https://help.github.com/en/github/getting-started-with-github/fork-a-repo
84+
[create a new branch]: https://guides.github.com/introduction/flow/
85+
[readme driven development]: https://tom.preston-werner.com/2010/08/23/readme-driven-development.html
86+
[commit]: https://help.github.com/en/desktop/contributing-to-projects/committing-and-reviewing-changes-to-your-project
87+
[create a pull request]: https://help.github.com/articles/creating-a-pull-request/
88+
[semantic versioning (semver)]: https://semver.org/
89+
[pull requests]: https://github.com/mineiros-io/terraform-github-repository/pulls
90+
[pre-commit-file]: https://github.com/mineiros-io/terraform-github-repository/blob/main/.pre-commit-config.yaml

0 commit comments

Comments
 (0)