Skip to content

Commit 9c84e93

Browse files
author
Edvard Makhlin
committed
Merge remote-tracking branch 'origin/main' into bb-comments-remove
2 parents 7daa4cf + f4a1263 commit 9c84e93

Some content is hidden

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

47 files changed

+3507
-3658
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
# that flag starts the download asynchronously so we'd have a race
1010
# condition.
1111
# renovate: datasource=github-releases depName=hashicorp/terraform versioning=hashicorp
12-
TERRAFORM_VERSION: 1.8.0
12+
TERRAFORM_VERSION: 1.8.2
1313
steps:
1414
- checkout
1515
- run: make build-service

.github/renovate.json5

+3-11
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
'pnpmDedupe',
2222
],
2323
prHourlyLimit: 1,
24-
lockFileMaintenance: {
25-
enabled: true,
26-
},
2724
osvVulnerabilityAlerts: true,
2825
vulnerabilityAlerts: {
2926
enabled: true,
@@ -33,14 +30,8 @@
3330
},
3431
packageRules: [
3532
{
36-
matchPackageNames: [
37-
'vuepress',
38-
'@vuepress/client',
39-
'@vuepress/markdown',
40-
'@vuepress/utils',
41-
],
42-
groupName: 'vuepress',
43-
allowedVersions: '!/pre.*$/',
33+
"matchFileNames": ["package.json"],
34+
"enabled": false
4435
},
4536
{
4637
matchFileNames: [
@@ -108,6 +99,7 @@
10899
customType: 'regex',
109100
fileMatch: [
110101
'.circleci/config.yml$',
102+
'^\\.github/workflows/[^/]+\\.ya?ml$',
111103
],
112104
matchStrings: [
113105
'renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\s.*?_VERSION: (?<currentValue>.*)\\s',

.github/workflows/codeql.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171

7272
# Initializes the CodeQL tools for scanning.
7373
- name: Initialize CodeQL
74-
uses: github/codeql-action/init@d39d31e687223d841ef683f52467bd88e9b21c14 # v3
74+
uses: github/codeql-action/init@ccf74c947955fd1cf117aef6a0e4e66191ef6f61 # v3
7575
with:
7676
languages: ${{ matrix.language }}
7777
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -85,7 +85,7 @@ jobs:
8585
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
8686
# If this step fails, then you should remove it and run the build manually (see below)
8787
- name: Autobuild
88-
uses: github/codeql-action/autobuild@d39d31e687223d841ef683f52467bd88e9b21c14 # v3
88+
uses: github/codeql-action/autobuild@ccf74c947955fd1cf117aef6a0e4e66191ef6f61 # v3
8989

9090
# ℹ️ Command-line programs to run using the OS shell.
9191
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -98,7 +98,7 @@ jobs:
9898
# ./location_of_script_within_repo/buildscript.sh
9999

100100
- name: Perform CodeQL Analysis
101-
uses: github/codeql-action/analyze@d39d31e687223d841ef683f52467bd88e9b21c14 # v3
101+
uses: github/codeql-action/analyze@ccf74c947955fd1cf117aef6a0e4e66191ef6f61 # v3
102102
with:
103103
category: "/language:${{matrix.language}}"
104104

.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
4343

4444
# need to setup go toolchain explicitly
45-
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
45+
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5
4646
with:
4747
go-version-file: go.mod
4848

.github/workflows/pr-size-labeler.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: pr-size
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
labeler:
7+
runs-on: ubuntu-latest
8+
name: Label the PR size
9+
steps:
10+
- uses: codelytv/pr-size-labeler@54ef36785e9f4cb5ecf1949cfc9b00dbb621d761 # v1
11+
with:
12+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
xs_label: 'size/xs'
14+
xs_max_size: '10'
15+
s_label: 'size/s'
16+
s_max_size: '200'
17+
m_label: 'size/m'
18+
m_max_size: '1000'
19+
l_label: 'size/l'
20+
l_max_size: '10000'
21+
xl_label: 'size/xl'
22+
fail_if_xl: 'false'
23+
message_if_xl: >
24+
This PR exceeds the recommended size of 1000 lines.
25+
Please make sure you are NOT addressing multiple issues with one PR.
26+
Note this PR might be rejected due to its size.
27+
github_api_url: 'https://api.github.com'
28+
files_to_ignore: ''

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
with:
1616
submodules: true
1717

18-
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
18+
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5
1919
with:
2020
go-version-file: go.mod
2121

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ jobs:
4141
if: needs.changes.outputs.should-run-tests == 'true'
4242
name: Tests
4343
runs-on: ubuntu-22.04
44-
container: ghcr.io/runatlantis/testing-env:latest@sha256:da00ef8402ff55f1b0fee66187d4b3716991487d4515f8e4ae35427b1cb303ea
44+
container: ghcr.io/runatlantis/testing-env:latest@sha256:cdc9167a438867db77fcdc2a524316c5a1e98ba6e2c936e19f3c7220eedc95d8
4545
steps:
4646
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
4747

4848
# need to setup go toolchain explicitly
49-
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
49+
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5
5050
with:
5151
go-version-file: go.mod
5252

.github/workflows/website.yml

+5
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ jobs:
6767
# start http-server for integration testing
6868
npx http-server runatlantis.io/.vuepress/dist &
6969
70+
- name: Run Playwright E2E tests
71+
run: |
72+
pnpx playwright install --with-deps
73+
pnpm run e2e
74+
7075
- name: wait until server listened
7176
run: curl --retry-delay 1 --retry 30 --retry-all-error http://localhost:8080
7277

.gitignore

+9-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ output
88
.cover
99
.terraform/
1010
node_modules/
11-
**/.vuepress/*
1211
helm/test-values.yaml
1312
*.swp
1413
golangci-lint
@@ -27,3 +26,12 @@ tmp-CHANGELOG.md
2726

2827
# IDE files
2928
*.code-workspace
29+
30+
# draw.io backup files
31+
*.bkp
32+
33+
# vuepress
34+
**/.vuepress/*
35+
!runatlantis.io/.vuepress/config.*
36+
!runatlantis.io/.vuepress/navbar.*
37+
!runatlantis.io/.vuepress/sidebar.*

CONTRIBUTING.md

+41-24
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
1-
# Topics
2-
* [Reporting Issues](#reporting-issues)
3-
* [Reporting Security Issues](#reporting-security-issues)
4-
* [Updating The Website](#updating-the-website)
5-
* [Developing](#developing)
6-
* [Releasing](#creating-a-new-release)
1+
# Contributing <!-- omit in toc -->
2+
3+
# Table of Contents <!-- omit in toc -->
4+
- [Reporting Issues](#reporting-issues)
5+
- [Reporting Security Issues](#reporting-security-issues)
6+
- [Updating The Website](#updating-the-website)
7+
- [Developing](#developing)
8+
- [Running Atlantis Locally](#running-atlantis-locally)
9+
- [Running Atlantis With Local Changes](#running-atlantis-with-local-changes)
10+
- [Rebuilding](#rebuilding)
11+
- [Running Tests Locally](#running-tests-locally)
12+
- [Running Tests In Docker](#running-tests-in-docker)
13+
- [Calling Your Local Atlantis From GitHub](#calling-your-local-atlantis-from-github)
14+
- [Code Style](#code-style)
15+
- [Logging](#logging)
16+
- [Errors](#errors)
17+
- [Testing](#testing)
18+
- [Mocks](#mocks)
19+
- [Backporting Fixes](#backporting-fixes)
20+
- [Manual Backporting Fixes](#manual-backporting-fixes)
21+
- [Creating a New Release](#creating-a-new-release)
722

823
# Reporting Issues
924
* When reporting issues, please include the output of `atlantis version`.
@@ -23,11 +38,11 @@ open your browser to http://localhost:8080.
2338
## Running Atlantis Locally
2439
* Clone the repo from https://github.com/runatlantis/atlantis/
2540
* Compile Atlantis:
26-
```
41+
```sh
2742
go install
2843
```
2944
* Run Atlantis:
30-
```
45+
```sh
3146
atlantis server --gh-user <your username> --gh-token <your token> --repo-allowlist <your repo> --gh-webhook-secret <your webhook secret> --log-level debug
3247
```
3348
If you get an error like `command not found: atlantis`, ensure that `$GOPATH/bin` is in your `$PATH`.
@@ -36,62 +51,66 @@ open your browser to http://localhost:8080.
3651
Docker compose is set up to start an atlantis container and ngrok container in the same network in order to expose the atlantis instance to the internet. In order to do this, create a file in the repository called `atlantis.env` and add the required env vars for the atlantis server configuration.
3752

3853
e.g.
39-
```
54+
55+
```sh
56+
NGROK_AUTH=1234567890
57+
4058
ATLANTIS_GH_APP_ID=123
4159
ATLANTIS_GH_APP_KEY_FILE="/.ssh/somekey.pem"
4260
ATLANTIS_GH_WEBHOOK_SECRET=12345
4361
```
4462

45-
Note: `~/.ssh` is mounted to allow for referencing any local ssh keys
63+
Note: `~/.ssh` is mounted to allow for referencing any local ssh keys.
4664

4765
Following this just run:
4866

49-
```
67+
```sh
5068
make build-service
51-
docker-compose up
69+
docker-compose up --detach
70+
docker-compose logs --follow
5271
```
5372

5473
### Rebuilding
55-
5674
If the ngrok container is restarted, the url will change which is a hassle. Fortunately, when we make a code change, we can rebuild and restart the atlantis container easily without disrupting ngrok.
5775

5876
e.g.
5977

60-
```
78+
```sh
6179
make build-service
6280
docker-compose up --detach --build
6381
```
6482

65-
## Running Tests Locally:
66-
83+
## Running Tests Locally
6784
`make test`. If you want to run the integration tests that actually run real `terraform` commands, run `make test-all`.
6885

69-
## Running Tests In Docker:
70-
```
86+
## Running Tests In Docker
87+
```sh
7188
docker run --rm -v $(pwd):/go/src/github.com/runatlantis/atlantis -w /go/src/github.com/runatlantis/atlantis ghcr.io/runatlantis/testing-env:latest make test
7289
```
7390

7491
Or to run the integration tests
75-
```
92+
93+
```sh
7694
docker run --rm -v $(pwd):/go/src/github.com/runatlantis/atlantis -w /go/src/github.com/runatlantis/atlantis ghcr.io/runatlantis/testing-env:latest make test-all
7795
```
7896

7997
## Calling Your Local Atlantis From GitHub
8098
- Create a test terraform repository in your GitHub.
8199
- Create a personal access token for Atlantis. See [Create a GitHub token](https://github.com/runatlantis/atlantis/tree/main/runatlantis.io/docs/access-credentials.md#generating-an-access-token).
82100
- Start Atlantis in server mode using that token:
83-
```
101+
```sh
84102
atlantis server --gh-user <your username> --gh-token <your token> --repo-allowlist <your repo> --gh-webhook-secret <your webhook secret> --log-level debug
85103
```
86104
- Download ngrok from https://ngrok.com/download. This will enable you to expose Atlantis running on your laptop to the internet so GitHub can call it.
87105
- When you've downloaded and extracted ngrok, run it on port `4141`:
88-
```
106+
```sh
89107
ngrok http 4141
90108
```
91109
- Create a Webhook in your repo and use the `https` url that `ngrok` printed out after running `ngrok http 4141`. Be sure to append `/events` so your webhook url looks something like `https://efce3bcd.ngrok.io/events`. See [Add GitHub Webhook](https://github.com/runatlantis/atlantis/blob/main/runatlantis.io/docs/configuring-webhooks.md#configuring-webhooks).
92110
- Create a pull request and type `atlantis help`. You should see the request in the `ngrok` and Atlantis logs and you should also see Atlantis comment back.
93111
94112
## Code Style
113+
95114
### Logging
96115
- `ctx.Log` should be available in most methods. If not, pass it down.
97116
- levels:
@@ -161,12 +180,11 @@ go get github.com/petergtz/pegomock/...
161180
```
162181
163182
# Backporting Fixes
164-
165183
Atlantis now uses a [cherry-pick-bot](https://github.com/googleapis/repo-automation-bots/tree/main/packages/cherry-pick-bot) from Google. The bot assists in maintaining changes across releases branches by easily cherry-picking changes via pull requests.
166184
167185
Maintainers and Core Contributors can add a comment to a pull request:
168186
169-
```
187+
```sh
170188
/cherry-pick target-branch-name
171189
```
172190
@@ -175,7 +193,6 @@ target-branch-name is the branch to cherry-pick to. cherry-pick-bot will cherry-
175193
The bot will immediately try to cherry-pick a merged PR. On unmerged pull request, it will not do anything immediately, but wait until merge. You can comment multiple times on a PR for multiple release branches.
176194
177195
## Manual Backporting Fixes
178-
179196
The bot will fail to cherry-pick if the feature branches' git history is not linear (merge commits instead of rebase). In that case, you will need to manually cherry-pick the squashed merged commit from main to the release branch
180197
181198
1. Switch to the release branch intended for the fix.

docker-compose.yml

+37-38
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,41 @@
11
# Note: This file is only used for Atlantis local development
2-
version: "3.8"
32
services:
4-
ngrok:
5-
image: wernight/ngrok:latest@sha256:d211f29ebcfe5f4e72df4fa8bdd9a667886e127d7fcb1be4a1af5ad83a8a1b77
6-
ports:
7-
- 4040:4040
8-
environment:
9-
# https://dashboard.ngrok.com/get-started/your-authtoken
10-
# NGROK_AUTH: REPLACE-WITH-YOUR-TOKEN // set this in atlantis.env
11-
NGROK_PROTOCOL: http
12-
NGROK_PORT: atlantis:4141
13-
env_file:
14-
- ./atlantis.env
15-
depends_on:
16-
- atlantis
17-
redis:
18-
image: redis:7.2-alpine@sha256:a40e29800d387e3cf9431902e1e7a362e4d819233d68ae39380532c3310091ac
19-
restart: always
20-
ports:
21-
- '6379:6379'
22-
command: redis-server --save 20 1 --loglevel warning --requirepass test123
23-
volumes:
24-
- redis:/data
25-
atlantis:
26-
depends_on:
27-
- redis
28-
build:
29-
context: .
30-
dockerfile: Dockerfile.dev
31-
ports:
32-
- 4141:4141
33-
volumes:
34-
- ~/.ssh:/.ssh
35-
- ./:/atlantis/src
36-
# Contains the flags that atlantis uses in env var form
37-
env_file:
38-
- ./atlantis.env
3+
ngrok:
4+
image: wernight/ngrok:latest@sha256:d211f29ebcfe5f4e72df4fa8bdd9a667886e127d7fcb1be4a1af5ad83a8a1b77
5+
ports:
6+
- 4040:4040
7+
environment:
8+
# https://dashboard.ngrok.com/get-started/your-authtoken
9+
# NGROK_AUTH: REPLACE-WITH-YOUR-TOKEN // set this in atlantis.env
10+
NGROK_PROTOCOL: http
11+
NGROK_PORT: atlantis:4141
12+
env_file:
13+
- atlantis.env
14+
depends_on:
15+
- atlantis
16+
redis:
17+
image: redis:7.2-alpine@sha256:a40e29800d387e3cf9431902e1e7a362e4d819233d68ae39380532c3310091ac
18+
restart: always
19+
ports:
20+
- 6379:6379
21+
command: redis-server --save 20 1 --loglevel warning --requirepass test123
22+
volumes:
23+
- redis:/data
24+
atlantis:
25+
depends_on:
26+
- redis
27+
build:
28+
context: .
29+
dockerfile: Dockerfile.dev
30+
ports:
31+
- 4141:4141
32+
volumes:
33+
- ${HOME}/.ssh:/.ssh:ro
34+
- ${PWD}:/atlantis/src:ro
35+
# Contains the flags that atlantis uses in env var form
36+
env_file:
37+
- atlantis.env
3938

4039
volumes:
41-
redis:
42-
driver: local
40+
redis:
41+
driver: local

0 commit comments

Comments
 (0)