* 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>
* 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>
* 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
* 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
* fix(web-templates): use CleanedBasePath for static content
When setting '--atlantis-url' this static content 404s.
For example, we can see this when comparig:
- /lock --> works seamless with a custom `--atlantis-url`
- /jobs --> doesn't work when using a custom `--atlantis-url`
* fix(web-templates): regenerate bindata_assetfs
* Add UUID for Log Streaming Job ID (#167)
* Update log handler to close buffered channels when an operation is complete (#170)
* Add preliminary check before registering new receivers in the log handler (#173)
* Using projectOutputBuffers to check for jobID instead of receiverBuffers (#181)
* Refactor log handler (#175)
* Reverting go.mod and go.sum
* Fix lint errors
* Fix linting
* Replacing . with _ when generating project identifier if project name is not set
* Adding test for GenerateProjectJobURL when working dir set to .
* Replacing . with _ when generating project identifier if project name is not set
* Fixing merge conflicts
* Add benchmark for /healthz endpoint
This benchmark will measure not only speed but also how much memory
each request to /healthz allocate. I'm adding the benchmark to have a
baseline to compare.
Signed-off-by: Leandro López (inkel) <inkel.ar@gmail.com>
* Hardcode /healthz body into a variable
We know it will always be this value, there's no need to import and
call json.MarshalIndent.
Signed-off-by: Leandro López (inkel) <inkel.ar@gmail.com>
* Initialize /healthz body only once
Signed-off-by: Leandro López (inkel) <inkel.ar@gmail.com>
The plan step has a mechanism to use the default tf version from the Terraform
client if the context does not define one, however the apply step does not have
this. This results in remote executions of apply failing with a nil pointer
dereference when it checks tfVersion in StripRefreshingFromPlanOutput. This fix
involves copying what the PlanStepRunner does and falls back to the default
version if the context's version is nil.
* adds AllowedRegexpPrefixes config and use it on the FindProjectsByName method
* adds tests for the new AllowedRegexpPrefixes config
* update documentation with the new AllowedRegexpPrefixes config
* docs: document approve_policies command in help
The `approve_policies` command was added with policy checking but was
never included in the command parser help.
Also update the comments in the file to reflect all of the commands.
* feat: Better message on policy failure
Include the specific command `approve_policies` in the message.
* add .devcontainer to .gitignore
* allow AzureDevOps host to be specified in the user_config
* fix spacing issues
* gofmt
* fixes to cmd and update to approach
* add specific self host fixtures
* add specific self host parser tests
* update code to azure self hosted devops
* go fmt
Co-authored-by: atlantisbot <lkysow+atlantis@gmail.com>
* add .devcontainer to .gitignore
* allow AzureDevOps host to be specified in the user_config
* fix spacing issues
* gofmt
* fixes to cmd and update to approach
Co-authored-by: atlantisbot <lkysow+atlantis@gmail.com>
* Migrate dgrijalva/jwt-go to golang-jwt/jwt/v4
dgrijalva's jwt is no longer maintained. The golang-jwt says it is a
drop in replacement for v4. This also fixes CVE-2020-26160 which
possibly won't be fixed in dgrijalva's version.
* Update occurrences of bradleyfalzon/ghinstallation to v2
v2.0.3 pulls in golang-jwt/jwt over the now unmaintained
dgrijalva/jwt-go.
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* Improve github pull request call retries
Retry with fixed 1 second backoff up to 3 retries was added by #1131 to
address #1019, but the issue continued to show up (#1453).
Increase max attempts to 5 and use exponential backoff for a maximum
total retry time of (2^n - n - 1) seconds, which is roughly 30 seconds
for current max attempts n = 5.
Also move the sleep to the top of the loop so that we never sleep
without sending the request again on the last iteration.
* Fix style with gofmt -s
* Add support for deleting a branch on merge in BitBucket Server
* Add support for deleting a branch on merge in BitBucket Server
* Making linter happy although the code would fall through and return err anyway.
* Add client_test for deleting source branch
* Added err check
Co-authored-by: Wendell Beckwith <wendell.beckwith@redfin.com>