Commit Graph

2088 Commits

Author SHA1 Message Date
Rui Chen
b1fb97047b links(github): replace help.github.com with docs.github.com links (#2227)
* links(github): replace help.github.com with docs.github.com links

* fix another link

Signed-off-by: Rui Chen <rui@chenrui.dev>
v0.19.3-pre.20220429
2022-04-29 17:35:42 -04:00
dependabot[bot]
7bff8d79c6 build(deps): bump github.com/spf13/viper from 1.10.1 to 1.11.0 (#2206)
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.10.1 to 1.11.0.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.10.1...v1.11.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-22 21:27:29 -04:00
Derek Gaffney
22dec19df7 chore: update alpine base to v3.15.4 (#2202) 2022-04-19 17:10:27 -04:00
Rui Chen
8184b51e6c deps: bump terraform to v1.1.8 (#2196) 2022-04-16 18:39:44 -04:00
dependabot[bot]
c43c0437ff build(deps): bump actions/setup-go from 2 to 3 (#2194)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 12:27:50 -04:00
dependabot[bot]
12599bcf92 build(deps): bump actions/stale from 4 to 5 (#2195)
Bumps [actions/stale](https://github.com/actions/stale) from 4 to 5.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 12:27:44 -04:00
KevinSnyderCodes
1a8344489f fix: add path to WorkingDir methods (#2180)
* fix: add path to WorkingDir methods

`WorkingDirLocker` and `WorkingDir` are closely related -- the former acquires a lock, which ensures that the latter can safely operate on a given file path.

In #2131 we added `path` to the `WorkingDirLocker` lock key, but neglected to add the same to `WorkingDir`.

This commit adds `path` as an argument to certain `WorkingDir` methods, and includes `path` in the directory that we use to clone the repository for a given project.

Since `path` can include certain special characters such as `/`, we encode `path` as base32 when using it as part of a file path. This should ensure no special characters are used in the filesystem, and that the value can be decoded if desired (unlike hashes such as md5).

Additional changes:

- All calls to changed methods have been updated, including unit tests
- Mocks have been regenerated for `WorkingDir` and `WorkingDirLocker`
- `working_dir_test.go`
  - Commands that operate on filesystem paths have been updated to include the base32 encoded `path` value
  - When running `git init`, we include `-b master` as additional arguments, to ensure that `master` is our default branch (expected by the unit tests)

* Try fixing E2E tests

* Fix DefaultPendingPlanFinder

In addition to iterating over `workspaceDirs`, also iterate over `pathDirs`, and use both `workspace` and `path` to build `repoDir`.

* Fix DefaultPendingPlanFinder unit tests

* Fix DefaultProjectCommandBuilder unit tests

Co-authored-by: Kevin Snyder <kevinsnyder@KevinSnydersMBP.lan>
Co-authored-by: Kevin Snyder <kevinsnyder@ip-192-168-1-188.ec2.internal>
v0.19.3-pre.20220408
2022-04-08 11:55:35 -07:00
Joshua S
25eea31689 fix: allow Github App to clone forks of a private repository (#2044)
fix: only fetch "pull/$PR_NUMBER/head" when githubAppEnabled
2022-04-08 11:51:31 -07:00
Ed Laur
f8811e60ed docs: fix apply requirements list (#2170) 2022-04-08 11:49:24 -07:00
Rui Chen
aa34673c62 fix: update CAHNEGLOG.md to avoid git dirty state
see, https://goreleaser.com/errors/dirty/

Signed-off-by: Rui Chen <rui@chenrui.dev>
v0.19.2-pre.20220408
2022-04-08 13:10:01 -04:00
Rui Chen
3f2b8787d8 release: add pre-release flow (#2185)
* release: add pre-release flow

* update image creation flow

Signed-off-by: Rui Chen <rui@chenrui.dev>
2022-04-08 13:03:11 -04:00
PePe Amengual
7199ea4a7e fix: reverting change to command status logic (#2173) 2022-03-31 11:51:49 -04:00
dependabot[bot]
69c49a13ab build(deps): bump minimist from 1.2.0 to 1.2.6 (#2165)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.0 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.0...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-28 18:59:48 -04:00
dependabot[bot]
f332466e22 build(deps): bump github.com/golang-jwt/jwt/v4 from 4.3.0 to 4.4.1 (#2167)
Bumps [github.com/golang-jwt/jwt/v4](https://github.com/golang-jwt/jwt) from 4.3.0 to 4.4.1.
- [Release notes](https://github.com/golang-jwt/jwt/releases)
- [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md)
- [Commits](https://github.com/golang-jwt/jwt/compare/v4.3.0...v4.4.1)

---
updated-dependencies:
- dependency-name: github.com/golang-jwt/jwt/v4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-28 11:10:51 -04:00
dependabot[bot]
97d60fd143 build(deps): bump github.com/stretchr/testify from 1.7.0 to 1.7.1 (#2153)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.0...v1.7.1)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-25 18:35:40 -04:00
George Didok
6c2dcb589c build(deps): bump alpine base image from 3.15 to 3.15.2 (#2161)
Co-authored-by: George Didok <gdidok@oanda.com>
2022-03-24 20:11:27 -04:00
KevinSnyderCodes
3ffd1c57df fix: unit tests for DefaultWorkingDirLocker.TryLock() (#2159)
* fix: add path to DefaultWorkingDirLocker.TryLock()

In the release notes for v0.13.0: https://github.com/runatlantis/atlantis/blob/master/CHANGELOG.md#features-4

> Running in parallel is only supported if you're using workspaces to separate your projects. Projects in separate directories can not be run in parallel currently.

This commit adds `path` as an argument to `DefaultWorkingDirLocker.TryLock()` and includes `path` in the `workspaceKey` used to check if a project is locked. This should allow projects in separate directories to run in parallel.

To my knowledge, there is no functional reason that projects in separate directories cannot run in parallel.

All calls to `DefaultWorkingDirLocker.TryLock()` have been updated. A new unit test `TestTryLockWithDifferentPaths` has been added to test the behavior of locking two separate directories with the same workspace name.

* Add documntation for parallel_plan and parallel_apply options

* Fix working_dir_locker_test.go

- Fix expected error message for `TestTryLock()`
- Use `.` as default path for calls to `DefaultWorkingDirLocker.TryLock()`

Co-authored-by: Kevin Snyder <kevinsnyder@ip-192-168-4-61.ec2.internal>
Co-authored-by: Kevin Snyder <kevinsnyder@ip-10-60-10-94.ec2.internal>
Co-authored-by: Kevin Snyder <kevinsnyder@Kevin-Snyders-MacBook-Pro.local>
Co-authored-by: Kevin Snyder <kevinsnyder@ip-10-60-10-189.ec2.internal>
Co-authored-by: Rui Chen <rui@chenrui.dev>
2022-03-22 15:05:00 -07:00
rui
7fd7503d34 workflow(tester): fix gotest runs for PRs (#2160)
Signed-off-by: Rui Chen <rui@chenrui.dev>
2022-03-22 17:29:07 -04:00
KevinSnyderCodes
5288389897 fix: allow projects in separate directories to run in parallel (#2131)
* fix: add path to DefaultWorkingDirLocker.TryLock()

In the release notes for v0.13.0: https://github.com/runatlantis/atlantis/blob/master/CHANGELOG.md#features-4

> Running in parallel is only supported if you're using workspaces to separate your projects. Projects in separate directories can not be run in parallel currently.

This commit adds `path` as an argument to `DefaultWorkingDirLocker.TryLock()` and includes `path` in the `workspaceKey` used to check if a project is locked. This should allow projects in separate directories to run in parallel.

To my knowledge, there is no functional reason that projects in separate directories cannot run in parallel.

All calls to `DefaultWorkingDirLocker.TryLock()` have been updated. A new unit test `TestTryLockWithDifferentPaths` has been added to test the behavior of locking two separate directories with the same workspace name.

* Add documntation for parallel_plan and parallel_apply options

Co-authored-by: Kevin Snyder <kevinsnyder@ip-192-168-4-61.ec2.internal>
Co-authored-by: Kevin Snyder <kevinsnyder@ip-10-60-10-94.ec2.internal>
2022-03-21 16:08:52 -07:00
Sarvar Muminov
90e92e3a13 chore: move CommandContext and CommandResult to models (#193) (#2093)
* Moved CommandContext and CommandResult to models (#193)

* Moved CommandContext and CommandResult to models

* move from models to command

rename CommandContext -> Context
rename CommandResult -> Result

* moved command related helpers into command package

* move ProjectCommandContext and ProjectResult to command/project package

* move project command context and project result

* revert unrelated code

* move tests

* fix left over

* fix linting

* fix tests

* remove unused import

* fix project context dependencies

* fix depenedecies

* fix typo
2022-03-21 10:36:13 -07:00
Nish Krishnan
d1d1539ced feat: Add stats support for basic operations (#2147) 2022-03-18 15:18:13 -07:00
dependabot[bot]
2453e43ab1 build(deps): bump github.com/xanzy/go-gitlab from 0.58.0 to 0.59.0 (#2140)
Bumps [github.com/xanzy/go-gitlab](https://github.com/xanzy/go-gitlab) from 0.58.0 to 0.59.0.
- [Release notes](https://github.com/xanzy/go-gitlab/releases)
- [Changelog](https://github.com/xanzy/go-gitlab/blob/master/releases_test.go)
- [Commits](https://github.com/xanzy/go-gitlab/compare/v0.58.0...v0.59.0)

---
updated-dependencies:
- dependency-name: github.com/xanzy/go-gitlab
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-16 12:59:18 -04:00
rui
76d7080b60 release: 0.19.2 (#2133)
* release: 0.19.2

Signed-off-by: Rui Chen <rui@chenrui.dev>

* update changelog

Signed-off-by: Rui Chen <rui@chenrui.dev>
v0.19.2
2022-03-11 08:47:48 -05:00
MB
fee3a4a292 docs: update docker registry link to ghcr (#2130)
Issue #2103
2022-03-11 08:29:17 -05:00
Raymond Chen
4e4568501d fix: fix unmarshall error in graphql call (#2128)
* Fix unmarshall error in GraphQL call #2090

* Add unit tests for GetTeamNamesForUser

* Fix lint error
2022-03-09 14:37:58 -08:00
rui
d1a10153ad release: 0.19.1 (#2122)
* release: 0.19.1

update changelog

Signed-off-by: Rui Chen <rui@chenrui.dev>

* add comments about gitlab and bitbucketcloud fixes

Signed-off-by: Rui Chen <rui@chenrui.dev>
v0.19.1
2022-03-07 12:48:07 -05:00
rui
797b12de34 fix(gitlab): update tests (relates to #1971) (#2120)
Signed-off-by: Rui Chen <rui@chenrui.dev>
2022-03-07 12:06:56 -05:00
Maxime Brunet
24e8cf7a79 fix(bitbucketcloud)!: Use AccountID as username instead of Nickname (#2034)
* fix(bitbucketcloud)!: Use AccountID as username instead of Nickname

* Update PullRequest.Author as well

* Remove unused Nickname field
2022-03-07 11:57:10 -05:00
Frank
898118501c fix(gitlab): change pending to running state (#1971)
* fix(gitlab-client): change pending to running state

* change default state
2022-03-07 11:24:26 -05:00
Maxime Brunet
f9a41c9bc6 fix(bitbucketcloud): Ensure status key has at most 40 characters (#2037)
* fix(bitbucketcloud): Ensure status key has at most 40 characters

* Use fmt.Sprintf()
2022-03-07 11:19:55 -05:00
dependabot[bot]
4db917dacd build(deps): bump github.com/xanzy/go-gitlab from 0.55.1 to 0.58.0 (#2118)
Bumps [github.com/xanzy/go-gitlab](https://github.com/xanzy/go-gitlab) from 0.55.1 to 0.58.0.
- [Release notes](https://github.com/xanzy/go-gitlab/releases)
- [Changelog](https://github.com/xanzy/go-gitlab/blob/master/releases_test.go)
- [Commits](https://github.com/xanzy/go-gitlab/compare/v0.55.1...v0.58.0)

---
updated-dependencies:
- dependency-name: github.com/xanzy/go-gitlab
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-07 11:18:51 -05:00
dependabot[bot]
59929b85b4 build(deps): bump actions/checkout from 2 to 3 (#2119)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-07 11:18:40 -05:00
rui
cb018a5167 release: 0.19.0 (#2115)
Signed-off-by: Rui Chen <rui@chenrui.dev>

update release notes

Signed-off-by: Rui Chen <rui@chenrui.dev>
v0.19.0
2022-03-04 15:33:14 -05:00
Andre Ziviani
1a7cc360a9 feat: add a pending status for apply when running plan command (#2053)
* add a pending status for apply when running plan command

* fix status updater logic, we should only update the status after we check if the PR is mergeable like the doc next to it says

* do not dismiss the PR if the only our "atlantis/apply" status is pending/failing

* fix logic and tests

* linting
2022-03-04 14:49:54 -05:00
Rui Chen
534ccb049e deps(docker): bump atlantis-base from 2022.03.03 to 2022.03.04 (multi-platform image)
Signed-off-by: Rui Chen <rui@chenrui.dev>
2022-03-04 14:05:06 -05:00
Jeppe Fihl-Pearson
19d41abc3c fix(docker): Multi-arch Docker images, attempt two (#2114)
* fix(docker): fix base image for multi-platform build (#2099)

* Correct indentation of run commands

* Split installation of packages into the ones needed at run time and build time

This allows us to now repeat the packages which need to be uninstalled again by
making use of a virtual package, which - when removed - removes the packages
installed as a dependency of it.

* Remove unnecessary `rm -rf /var/cache/apk/*` command

It's no needed when `apt add` is run with the `--no-cache` option.

* Add vertical spacing so it's clearer what is happening when

* Test the downloaded binaries to make sure they work on the platform

This can help find issues where binaries are downloaded for the wrong platform
compared to the architecture the Docker image is built for.

* Install dumb-init via apk

It's available as a package for Alpine Linux in version 1.2.5 as well, which
makes it easier to handle for the different architectures.

* Get git-lfs binaries in the right architecture for the Docker image

This makes use of the `TARGETPLATFORM` argument which automatically is
populated by Docker BuildKit with a string such as "linux/amd64" when the image
is being build for an x86_64 architecture.

* Install gosu for the right architecture

The `case` statement was taken from
https://github.com/BretFisher/multi-platform-docker-build as a way of
translating the platform name into what we needed for downloading gosu.

* fix(docker): fix installation of git-lfs in armv7 image (#2100)

This uses a similar pattern than what is used for `GOSU_ARCH` to map the
`TARGETPLATFORM` argument into the name of the architecture git-lfs use for
their release binaries, as "linux/arm/v7" otherwise would be mapped into "v7"
which is wrong.

* fix(docker): download Terraform and conftest versions maching image architecture (#2101)

* Remove Terraform versions from Docker image which don't have all archs

Terraform versions earlier than 0.11.15 does not have binaries available for
both amd64, arm64 and armv7, so are being dropped as we can't install the older
versions in all the architectures the Docker image is built for.

* Download Terraform version depending on the architecture Docker image is for

This avoids us having arm64 binaries for the ARM Docker images, which won't
work.

* Download arm64 conftest binaries for arm64 Docker image

This doesn't fix the armv7 Docker image because conftest doesn't have a binary
available for that, so it for now still downloads the x86_64 binary, which is
likely to not work - but it's the same as it did before.

* Correct path to dumb-init in docker-entrypoint.sh

The path changed after dumb-init was switched to be installed via `apk` rather
than downloaded directly as a binary.
2022-03-04 13:51:00 -05:00
Aayush Gupta
a752a6bd22 docs: moving streaming logs section from top-level navigation to docs (#2066)
* Moving logs tab from top navigation bar to docs

* fixing link error

* Update runatlantis.io/.vuepress/config.js

Co-authored-by: Nish Krishnan <nishkrishnan@users.noreply.github.com>
2022-03-03 13:47:03 -05:00
rui
8719d209da release: 0.18.5 (#2107)
* release: 0.18.5

* update changelog

Signed-off-by: Rui Chen <rui@chenrui.dev>

* add issue ref for docker hub deprecation

Signed-off-by: Rui Chen <rui@chenrui.dev>
v0.18.5
2022-03-02 20:47:38 -05:00
rui
46cd2fb49b deps: tf 1.1.7 (#2108)
Signed-off-by: Rui Chen <rui@chenrui.dev>
2022-03-02 20:44:28 -05:00
Rui Chen
8337262fd2 deps(docker): bump atlantis-base from 2022.03.02 to 2022.03.03
Signed-off-by: Rui Chen <rui@chenrui.dev>
2022-03-02 20:09:47 -05:00
rui
1b145dac27 fix(docker): fix docker runtime issue (#2106)
* debug setup

* Revert "fix(docker): download Terraform and conftest versions maching image architecture (#2101)"

This reverts commit 579e583740.

* Revert "fix(docker): fix installation of git-lfs in armv7 image (#2100)"

This reverts commit 8af78838b6.

* Revert "fix(docker): fix base image for multi-platform build (#2099)"

This reverts commit 571543fdfb.

* Revert "debug setup"

This reverts commit 274501ab6e.
2022-03-02 20:01:28 -05:00
rui
94eccee147 ci: drop circleci docker hub update (#2102)
Signed-off-by: Rui Chen <rui@chenrui.dev>
2022-03-02 12:44:56 -05:00
Rui Chen
8c26e75f58 release: include #2101 into 0.18.4 release
Signed-off-by: Rui Chen <rui@chenrui.dev>
v0.18.4
2022-03-02 12:21:22 -05:00
Jeppe Fihl-Pearson
579e583740 fix(docker): download Terraform and conftest versions maching image architecture (#2101)
* Remove Terraform versions from Docker image which don't have all archs

Terraform versions earlier than 0.11.15 does not have binaries available for
both amd64, arm64 and armv7, so are being dropped as we can't install the older
versions in all the architectures the Docker image is built for.

* Download Terraform version depending on the architecture Docker image is for

This avoids us having arm64 binaries for the ARM Docker images, which won't
work.

* Download arm64 conftest binaries for arm64 Docker image

This doesn't fix the armv7 Docker image because conftest doesn't have a binary
available for that, so it for now still downloads the x86_64 binary, which is
likely to not work - but it's the same as it did before.
2022-03-02 12:20:00 -05:00
rui
34baf6d030 release: 0.18.4 (#2097)
* release: 0.18.4

Signed-off-by: Rui Chen <rui@chenrui.dev>

* update changelog

Signed-off-by: Rui Chen <rui@chenrui.dev>
2022-03-02 11:59:48 -05:00
Jeppe Fihl-Pearson
8af78838b6 fix(docker): fix installation of git-lfs in armv7 image (#2100)
This uses a similar pattern than what is used for `GOSU_ARCH` to map the
`TARGETPLATFORM` argument into the name of the architecture git-lfs use for
their release binaries, as "linux/arm/v7" otherwise would be mapped into "v7"
which is wrong.
2022-03-02 11:29:28 -05:00
Jeppe Fihl-Pearson
571543fdfb fix(docker): fix base image for multi-platform build (#2099)
* Correct indentation of run commands

* Split installation of packages into the ones needed at run time and build time

This allows us to now repeat the packages which need to be uninstalled again by
making use of a virtual package, which - when removed - removes the packages
installed as a dependency of it.

* Remove unnecessary `rm -rf /var/cache/apk/*` command

It's no needed when `apt add` is run with the `--no-cache` option.

* Add vertical spacing so it's clearer what is happening when

* Test the downloaded binaries to make sure they work on the platform

This can help find issues where binaries are downloaded for the wrong platform
compared to the architecture the Docker image is built for.

* Install dumb-init via apk

It's available as a package for Alpine Linux in version 1.2.5 as well, which
makes it easier to handle for the different architectures.

* Get git-lfs binaries in the right architecture for the Docker image

This makes use of the `TARGETPLATFORM` argument which automatically is
populated by Docker BuildKit with a string such as "linux/amd64" when the image
is being build for an x86_64 architecture.

* Install gosu for the right architecture

The `case` statement was taken from
https://github.com/BretFisher/multi-platform-docker-build as a way of
translating the platform name into what we needed for downloading gosu.
2022-03-02 11:08:03 -05:00
Rui Chen
23e2b155bd deps(docker): use atlantis-base:2022.03.02
Signed-off-by: Rui Chen <rui@chenrui.dev>
2022-03-02 00:32:39 -05:00
rui
e0e5bf842d update dependencies (#2098) 2022-03-01 23:40:40 -05:00
Artem A
b9f6718194 docker: bump git-lfs and gosu dependencies (#2096) 2022-03-01 23:40:15 -05:00