Commit Graph

54 Commits

Author SHA1 Message Date
Gábor Lipták
ec84dc861f Correct typo (#1425) 2021-02-23 17:04:07 -05:00
Nish Krishnan
8598c37671 Support pre-workflow hooks on all comment/auto triggered commands. (#43) (#1418)
Fixes pre-workflow-hooks not logging errors #1371
Prevents pre-workflow-hook from locking and cloning the dir if there are no hooks registered. #1342
2021-02-22 08:34:26 -08:00
Sarvar Muminov
af2a806870 Implement a new policy check workflow (#1317)
* Adding policy_check support into yaml config

* Added policy check model and runtime structs

* Adding BuildPolicyCheckCommand to ProjectCommandBuilder

* Return incorrectly deleted code

* Remove BuildAutoPolicyPlanCommand from ProjectCommandBuilder

* Split runAutoCommand into two functions

runAutoPlanCommand - does what originally RunAutoplancommand was doing
except now it returns CommandResult and []models.ProjectCommandContext
runAutoPolicyCheckCommand - accepts CommandContext, CommandResult, and
[]models.ProjectCommandContext as arguments and runs PolicyCheckStep runner

* Refactor RunCommentCommand
* Remove BuildPolicyCheckCommand and rename StepCmdExec back to TerraformExec
* Add policy step runner logic and conftest interfaces.
* Add show step runner to policy check stage.

* Adding models.PolicyCheckCommand to buildCtx

This also means buildPlanAllCommands call buildCtx twice once with
models.PlanCommand and once with models.PolicyCheckCommand

* Adding new project_command_builder that supports policy_check

* Refactoring PolicyCheck specific logic into a PolicyCheckProjectCommandBuilder

* Moving events.CommandContext to models.CommandContext this will allow me
to remove buildCtx method and move ProjectCommandContext creation into
models package

* Policy Owners might be different types, for that reason we are
refactoring Owners into its own struct with specific keys defining
different owner types

Co-authored-by: Nish Krishnan <nishk@lyft.com>
Co-authored-by: Nish Krishnan <nishkrishnan@users.noreply.github.com>
2021-02-10 18:13:44 -08:00
Gerald Barker
d2610a78af Add Option to globally disable apply (#1230)
* Add Option to globally disable apply

Co-authored-by: Gerald Barker <geraldbarker@mail.com>
2020-10-27 21:01:39 -07:00
Nish Krishnan
0a7d6441fd lint. 2020-10-14 17:41:37 -07:00
Nish Krishnan
9fa0c91bcb [1193] Fix merge strategy for gh apps 2020-10-14 17:35:38 -07:00
ValdirGuerra
34f9f3f348 Add support for disable autoplan from server config 2020-08-18 15:55:22 -07:00
Chris Alexander
aa1bfc0a27 Add "plan" to continued statement 2020-07-01 10:11:33 -05:00
Luke Kysow
d3a6d18710 Merge remote-tracking branch 'origin/master' into deleted-status 2020-06-23 22:22:10 -07:00
Luke Kysow
4455e8b050 Merge pull request #1091 from runatlantis/unlock-cmd
Unlock cmd
2020-06-23 21:54:08 -07:00
Paris Morali
aed8d22b52 Implement atlantis unlock
This command is run on a pr and deletes all locks for the pr
2020-06-23 20:42:03 -07:00
parmouraly
abd2161bbb Fix typo from master merge conflict 2020-06-04 16:46:15 +01:00
parmouraly
ad512f100c Merge branch 'master' into fix-automerge-on-noapply 2020-06-04 16:32:25 +01:00
rob
227ce9cbf4 Upgrade to github/v31 for CompleteAppManifest
split fixtures out elsewhere, add working dir test
2020-06-03 20:18:13 -04:00
parmouraly
9689dbb981 Fix lint error 2020-06-03 17:08:16 +01:00
parmouraly
421b24738e Integrate some more PR feedback including a test 2020-06-03 17:00:30 +01:00
Luke Kysow
7b2a0efc82 Merge pull request #1048 from runatlantis/update-pegomock
Update pegomock
2020-05-25 16:55:45 -07:00
Luke Kysow
43ebee3175 Draining cleanup 2020-05-25 15:09:51 -07:00
Luke Kysow
78b1ea25d5 Refactor draining feature
- trigger on SIGTERM/INT rather than HTTP POST
- remove atlantis drain command
- refactor into generic status controller
2020-05-25 15:03:08 -07:00
Luke Kysow
8979a5fd09 Update pegomock 2020-05-25 11:58:50 -07:00
Paris Morali
cb26355da1 Add the rest of the BoltDB interface methods 2020-05-25 15:58:01 +01:00
Paris Morali
ade9b31593 Add BoltDB interface and some relevant tests
With BoltDB interface we are able to mock/stub and
improve test coverage.
Some other refactoring was required to make code aware
and compatible with the new interface
2020-05-11 15:13:36 +01:00
Benoit BERAUD
fa6477984c Fix failing test 2020-05-05 16:36:34 +02:00
Benoit BERAUD
c8bbad6de7 Add even more tests 2020-05-05 16:17:43 +02:00
Benoit BERAUD
46a1fe0595 small fixes 2020-05-05 16:15:24 +02:00
Luke Jolly
18208abdfc Added flag --silence-fork-pr-errors 2020-01-20 10:30:14 -06:00
Tim Birkett
d6cfe5b20e Add status-name command line arg, config and tests 2020-01-20 10:11:21 -06:00
David McPike
c346cce484 Merge remote-tracking branch 'upstream/master' into azure-devops 2019-08-30 12:48:47 -05:00
Luke Kysow
b81fe9a5e5 Switch to gomod 2019-08-26 18:38:22 +02:00
David McPike
f8d9e30a8e Update Azure Devops tests and get them to pass 2019-07-16 21:55:56 -05:00
David McPike
cb9bdb017d Resolve merge conflict on DisableApplyAll flag 2019-05-24 21:26:59 -05:00
Will Soula
b77a09dc97 Add --disable-apply-all flag
Add a flag to disable the use of the command `atlantis apply` so you
can enforce that each plan must be applied separately.
2019-05-23 12:09:51 -04:00
David McPike
4d11f8089a add Azure Devops pull getter support 2019-04-27 17:50:52 -05:00
Luke Kysow
4fc22aedeb Split status checks into plan and apply.
Split single top-level status check into one plan and one apply check.
These checks will also now track the whole pull request status rather
than just the last action.
2019-03-05 14:29:43 -05:00
Luke Kysow
5f4a94b0af Move CommandName to models package 2019-02-26 12:03:25 -05:00
Luke Kysow
1997e112d3 Remove duplicate vcs proxy interface
This is the same interface as vcs.Client so no need to have both.
2019-02-25 16:51:26 -05:00
Luke Kysow
74e9bbb82b Add automerge feature.
Automerging merges pull requests automatically if all plans have been
successfully applied.

* Save status of PR's to BoltDB so after each apply, we can check if
there are pending plans.
* Add new feature where we delete successful plans *unless* all plans
have succeeded *if* automerge is enabled. This was requested by users
because when automerge is enabled, they want to enforce that a pull
request's changes have been fully applied. They asked that plans not be
allowed to be applied "piecemeal" and instead, all plans must be
generated successfully prior to allowing any plans to be applied.
2019-02-06 16:27:43 -06:00
Luke Kysow
c4f89958d3 Tweak logging. Add timezone, use everywhere.
- Use logger for all warnings. Previously we were writing warnings from
cmd/server.go directly to stderr which bypassed our normal log format.
- Add the timezone to log output. This is just really nice to have if
you're looking at old logs.
- Change levels to all be 4 characters: DBUG, INFO, WARN, EROR. This
makes the logs easier to read because it lines up.
- Log when we first receive the request as well as when we send a
response. This makes it easier to see where the request starts and ends.
2018-12-19 13:40:13 -06:00
Luke Kysow
68ac049ad6 Write error comment on early failures.
Previously, we were just logging when an error happened early in our
comment processing code. However it's possible for us to write comments
on error even at this early stage which will make for a better user
experience.

Fixes #398
2018-12-19 13:26:27 -06:00
Luke Kysow
af419ef3e1 Fix gometalint errors 2018-09-07 10:54:48 -07:00
Luke Kysow
e9b7001266 Add godocs. Refactor ProjectResult. Golint errors. 2018-08-30 16:47:17 -06:00
Luke Kysow
3b02a1fc31 Test plan/apply all. 2018-08-09 14:23:44 -10:00
Luke Kysow
12a9a19fde First pass at naked plan/apply working on all. 2018-08-08 17:08:08 -10:00
Luke Kysow
6940bfa57e Rename enum 2018-08-02 20:26:05 -07:00
Luke Kysow
e2930e48e5 Test bitbucket parsing 2018-07-20 13:27:25 +02:00
Luke Kysow
bd8335f82f Rename CommitStatus enums 2018-07-20 12:43:48 +02:00
Luke Kysow
1fc4667c63 WIP bitbucket 2018-07-19 21:52:33 +02:00
Luke Kysow
13a70c772d Add new --allow-repo-config flag. 2018-06-30 23:27:15 +02:00
Luke Kysow
9e7509aeee Test command runner 2018-06-29 19:10:10 +02:00
Luke Kysow
12f071b237 Rename atlantisworkspace to workingdir. 2018-06-27 20:43:43 +02:00