* Running 'atlantis unlock' on a PR Causes The Whole Working Directory to be Deleted
* Update events controller tests
* Fix events controller tests
---------
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
* fix(deps): update module github.com/petergtz/pegomock/v3 to v4 in go.mod
* remove pegomock generate m option, which is not support after v4
* make regen-mocks
* replace pegomock v4 primitive eq/matchers
* convert pegomock v4 Eq/Any matchers
* remove custom models.Repo matcher
* pegomock v4 cannot use result method args
ref https://github.com/petergtz/pegomock/issues/123
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* disable pegomock --use-experimental-model-gen, cause random fail by segv
* make regen-mocks
* fix mock code which uses non experimental pegomock codes
* Initial build out of redis backend
* Regenerate locking mocks and matchers
* More test cleanup
* More test fixes
* Added tests for redis
* Test fix
* Linting fix
* Dcos update
* Update redis.go
* Update server.go
* Adding nolint to RedisDB struct
* 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>
* 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>
This is two changes:
Replacing all usages of SimpleLogger with it's interface SimpleLogging which makes it easier to swap out loggers going forward
Nukes SimpleLogger in favor of StructuredLogger which allows us to better analyze logs in our log management system we choose.