Commit Graph

76 Commits

Author SHA1 Message Date
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
1137a82c60 Add the ability to disable Atlantis locking a repo (#1340)
* Add the ability to disable Atlantis locking a repo

* Fix incorrect logic when creating locking Client

Co-authored-by: kbaldyga <kbaldyga@gmail.com>

* Add tests for noOpLocker to improve coverage

Co-authored-by: Gerald Barker <geraldbarker@mail.com>
Co-authored-by: kbaldyga <kbaldyga@gmail.com>
2021-01-14 10:20:27 -05:00
Nish Krishnan
1513ee6421 Add support for fetching gh app user. (#30) (#1334)
* Add support for fetching gh app user. (#30)

* Upgrade pegomock.

* go mod vendor.
2021-01-05 15:21:31 -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
dmattia
c24c5009aa configure using default 2020-09-03 11:09:45 -05:00
dmattia
605dde7b2b Fix typos 2020-09-03 10:57:52 -05:00
Luke Kysow
cd37563857 Merge pull request #1159 from runatlantis/disable-autoplan
Disable autoplan global flag
2020-08-18 15:59:59 -07:00
Luke Kysow
1b374fa3e6 Small refactor to disable-autoplan 2020-08-18 15:55:22 -07:00
ValdirGuerra
34f9f3f348 Add support for disable autoplan from server config 2020-08-18 15:55:22 -07:00
Quan Hoang
54e3dc2ef0 Skip cloning PR repository in case of no projects configured in repo config file were changed 2020-08-18 15:48:05 -07:00
Luke Kysow
8ac19e4017 Deprecate --repo-whitelist for --repo-allowlist 2020-07-25 23:50:09 -07:00
Luke Kysow
875abf1362 Refactoring to github app code
- rename gh-app-key to gh-app-key-file for clarity
- change git credentials writer to append a line if there is an existing
.git-credentials file and in the case of the github app to replace the
old github app line
- removed automatically setting --write-git-creds to true when using a
github app and instead requiring this is set specifically
2020-06-19 11:41:44 -07:00
rob
011d3f8229 Test against a live repo, fix accordingly
more docs, add installation step
2020-06-03 20:25:11 -04:00
Roberto Hidalgo
199cdfe192 Play around with github app credentials 2020-06-03 20:16:24 -04:00
CJ Ketchum
d7ce63742e Add test for plan-draft behavior 2020-05-25 16:45:38 -07:00
Christopher Ketchum
c300dee745 Add flag to toggle autoplanning on draft PRs 2020-05-25 16:28:55 -07:00
CJ Ketchum
611ed55c8c Fix parse URL tests 2020-04-10 14:36:53 -07:00
John Reese
e7dda13d65 Ignore casing on log levels 2020-04-03 20:56:54 -04:00
Mike Hume
35b6a1bdb2 Merge branch 'wrapped-default' into long-folding 2020-03-29 15:36:53 -07:00
CJ Ketchum
bc545844d3 Update autoplan so commit status is set only after finding projects (resolves #954) 2020-03-29 15:12:12 -07:00
Luke Kysow
b69336e477 Refactor cmd tests
- Remove config/env/flag override tests since we know that the overrides
work
- We'll no longer need to edit the tests now when we add new flags
2020-03-29 14:51:03 -07:00
Luke Kysow
46f33e6a22 Add missing tests 2020-01-20 10:39:05 -06:00
Luke Jolly
e84755349c Add Silence flags to server_test.go 2020-01-20 10:30:15 -06:00
Luke Kysow
ec92e43d4b Refactor --vcs-status-name flag. 2020-01-20 10:16:59 -06:00
Tim Birkett
d6cfe5b20e Add status-name command line arg, config and tests 2020-01-20 10:11:21 -06:00
Cullen McDermott
d4362ffec3 Add --tf-download-url configuration option 2020-01-20 09:19:54 -06:00
Luke Kysow
07ffe179e7 Small refactoring to azure devops support 2019-10-25 18:07:18 -07:00
David McPike
495cf76efd Azure Devops update
- Remove org and project configs
- Add support for WriteGitCreds
2019-09-23 08:24:59 -05:00
David McPike
b6dca2b05b Removes ADBasicAuth boolean flag 2019-09-22 16:35:16 -05:00
David McPike
a31afcb7a4 Merge tag 'v0.9.0' into azure-devops 2019-08-29 17:52:36 -05:00
Andrew Jeffree
e140823408 Add flag for configuring git-credentials-store
--write-git-creds will create a .git-credentials file and configure
git to use it. To allow authentication with your git remotes over https.
To access private repos.
2019-08-02 10:12:30 +10:00
David McPike
f8d9e30a8e Update Azure Devops tests and get them to pass 2019-07-16 21:55:56 -05:00
David McPike
eeaab9f6d7 Merge tag 'v0.8.3' into azure-devops 2019-07-12 23:27:43 -05:00
David McPike
03d1050939 Fix minor typo, reorder flags 2019-07-12 23:23:05 -05:00
Luke Kysow
ee8707d239 Add flag for setting Terraform Enterprise hostname (#706)
--tfe-hostname will allow for creating a .terraformrc file with a
different hostname than app.terraform.io
2019-07-12 15:19:43 +01:00
David McPike
cb9bdb017d Resolve merge conflict on DisableApplyAll flag 2019-05-24 21:26:59 -05:00
Luke Kysow
7595265a6b Finishing touches to disable-apply-all
- fix missing part of a test
- log when ignoring
2019-05-23 12:09:51 -04: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
2c832387d7 add azure devops cmd flags 2019-04-13 11:14:44 -05:00
David McPike
a17e565ba6 - switch to go-azuredevops package
- remove ADHostname
- add ADOrg and ADProject
2019-04-07 01:57:54 -05:00
David McPike
03bfefe9f4 continue azure devops support 2019-04-03 23:52:48 -05:00
David McPike
1946dc0477 merge from head 2019-04-03 23:48:04 -05:00
David McPike
cfcf59d8e0 continue adding skeleton for azure devops support 2019-04-03 21:30:14 -05:00
Luke Kysow
8982a67b78 Run latest goimports 2019-03-30 20:22:49 -05:00
Luke Kysow
b12d487cb2 Add new --repo-config-json flag
This flag will allow users to specify repo config as json instead of
writing a file to disk. This is useful in deployments where disk access
is more difficult, ex. Docker.
2019-03-27 19:52:58 -05:00
Luke Kysow
d78b106cab Refactor @jjulien's server-side config work. 2019-03-27 14:47:48 -05:00
John Julien
1fcdaba719 Added new --repo-config option and deprecated --allow-repo-config
This enables atlantis.yaml in all repos, but by default restricts
certain sensitive keys from being used.

The keys apply_requirements, workflow, and workflows can only be
specified in an atlantis.yaml file if explicitly allowed by a
server side repo config.

The repo config file provides the ability to specify a default set of
workflows, and default values for apply_requirements and workflow to use
use on a per repo basis.  It also supports applying to a collection of
repos by using regex to match a repo name.

If more than one repo name matches, the values from last repo matched
are used.

This deprecates the --allow-repo-config option
2019-03-27 14:47:48 -05:00
Luke Kysow
ca58ebd7e0 Autodownload tf versions. Add --default-tf-version.
This changeset has two features:
1. We now automatically download the version of terraform specified in
atlantis.yaml configs if we don't already have that version available
locally.

2. Add a new --default-tf-version flag that allows users to set a
default version of Terraform that we will also download if it's not on
disk.

These mean that users don't need to build custom Docker images to just
add terraform versions. It also means that upgrading the version of
terraform that is packaged with the Atlantis Docker image won't cause
issues for existing users because as long as they're running with
--default-tf-version, Atlantis will always use that version.
2019-03-14 13:51:27 -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
Jacob Foard
2e65e03055 Adding in slack-token to flags
Signed-off-by: Jacob Foard <jacob.foard@formation.ai>
2019-01-22 22:30:30 -05:00