* feat: state rm
* review feedback
* fix conflict for pegomock generation code
* adopt state command into allow-commands
* fix conflicts
* fix: state rm works on workspace
* notify import/state rm discard plan file
* fix lint
* use repeat instead warning for re-plan
* perl -pi -e 's!\* 🔁 plan file was discarded. to!🚮 A plan file was discarded. Re-plan would be required before applying.\n\n\* 🔁 To!g' server/**/*
* follow main branch
* atlantis import not works on workspace
* extract workspace_step_runner_delegate from plan_step_runner
* import step runner requires workspace delegate
* refactor: pull_status_fetcher contains vcsStatusName in struct / reduce FetchPullStatus parameter
* import_command_runner need to set ctx.PullRequestStatus for import_requirements
* make MarkdownRenderer private
* ExecutableName is available on markdown renderer common data
* replace template atlantis name with .ExecutableName
* MarkdownRenderer fields can be private, but itself needs public
* reuse commonData anywhere in renderer
* revert
* fix(discardApprovalOnPlan): add missing conditional and tests
* tests(discardApprovalOnPlan): match for any Pull request or repo for turned off discarding
* Apply suggestions from code review
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
* Update server/events/plan_command_runner.go
* Update server/events/plan_command_runner.go
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
* feat: --allow-command configuration restricts available atlantis commands
* add version and approve_policies into allow commands defaults
* allow-commands accept all keyword which allows all commands
* remove redundant nest
* more detail abount allow-commands all keyword
* Update server/events/comment_parser.go
* Move terraform version listing into Terraform client
* Add flag to disable Terraform downloads
* Fallback to exact version matching if unable to list TF versions
* Add new config option to documentation
* Fix and update tests
* Fix check-lint errors
* Change option name
* Remove obsolete commented code
* Migrate version detection logic into terraform client
* Improve consistency in new function signatures & log statements
* Test requests before calling terraform-switch, to prevent unnecessary crashes
* Fix broken tests
* Silence gosec error
* Close response body
* Add pre and post workflow hook status
* fix missing mocks
* fix pre/post workflow hooks tests
* add cmd output to file
* fix typo
* add cmd output to file on pre workflow hooks
* Add hooks output to web UI
* Remove unnecessary dependencies
* Clean the code and make tests work again
* Make lint happy
* Small fixes, create dedicated UUID generator and docs
* Add missing commentary
* Use matchers instead of mocking for tests and fix e2e tests
* Change 'OUTPUT_FILE' to 'OUTPUT_STATUS_FILE'
* Reduce SendWorkflowHook calls on hooks
* Apply suggestions from code review
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
* disable repo locking repos.yaml and atlantis.yaml with allow override
* rename disable_repo_locking into repo_locking
* add both enable/disable repo_locking test
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
* Add argument for enabling same origin check for websocket connections
* Remove else clause and outdent return
* Add unit test for websocket origin check
* Add a flag to silence policy checks comments when there's no error
* Add e2e test cases for the quiet policy checks flag
* add documentation for quiet-policy-checks flag
* Update user_config.go
Fix indentation
* Update user_config.go
* fmt
* Delete previous plans on autoplan or atlantis plan
When using non-default workspaces, plans are stored
in pr-and-workspace-specific directories.
If a PR is subsequently updated it might happen that
some of the plans are no longer relevant with regards
to the latest changes.
This change ensures that plans are always deleted
when a generic plan is triggered either by autoplan
or by a "atlantis plan" command.
NB Plans are not cleaned up when specific projects are
planned explicitly with "atlantis plan -p/-d/-w".
* Also delete locks along with plans when running
autoplan or generic plan command
* Fix Plan deletion tests after 0.19.8 rebase
* Fix Plan deletion tests after v0.19.9-pre.20220912 rebase
* Rename struct field to follow camelCase naming convention
Co-authored-by: giuli007 <giuglioz@gmail.com>
* 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
* Make required apply work with mergeable
* Fix lint hint
* Migrate mergeable approval check to graphql, update tests
* Adding support for check suites
* Adding feature flag protection for new functionality
* Fix linting falsepos
* Adjusted logic to handle required check runs, added doc
* Start threading job output to RunStepRunner
* Strip ANSI
* Fix lint
* Use waitgroup to avoid test flakiness
* Move waitgroup higher
* Add ANSI test and use strings.Builder
* Fix lint
* Use errors.Wrap per style guide
* Create ShellCommandRunner to encapsulate streaming
* WIP: shell command runner
* Update signatures to propagate error finding version
* Fix log output
* Fix error checking
* Fix accidental whitespace stripping
* Remove unused struct field
* Fix error checking in terraform client
* Add unit tests to verify command output handler was called
* Remove err from async interface
* Remove duplicative log now that shell command runner does it
* Hide output in stream for env/multienv
* Add comment explaining goroutines
* Use printf for better macOS compatibility
* Delete previous plans on autoplan or atlantis plan
When using non-default workspaces, plans are stored
in pr-and-workspace-specific directories.
If a PR is subsequently updated it might happen that
some of the plans are no longer relevant with regards
to the latest changes.
This change ensures that plans are always deleted
when a generic plan is triggered either by autoplan
or by a "atlantis plan" command.
NB Plans are not cleaned up when specific projects are
planned explicitly with "atlantis plan -p/-d/-w".
* Use DeleteLockCommand to delete locks and workdirs
containing previous plans
Co-authored-by: giuli007 <giuglioz@gmail.com>
* 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 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
* 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>