Commit Graph

810 Commits

Author SHA1 Message Date
Gábor Lipták
a4f0e3a467 Bump golangci to 1.39.0 (#1541)
Signed-off-by: Gábor Lipták <gliptak@gmail.com>
2021-05-26 21:00:20 -04:00
Sarvar Muminov
2a6f21e85d Attempting to fix e2e test (#1595)
* Attemting to fix e2e test

* remove comma

* no-op change

* scope down the fixtures

* remove unnecessary comment
2021-05-21 21:39:36 -07:00
rui
6468f1941b fix broken tests (#1590)
Signed-off-by: Rui Chen <rui@chenrui.dev>
2021-05-21 11:00:49 -04:00
Sarvar Muminov
dbce1d71e7 bump testing-env image (#1582)
* bump testing-env image

* use correct image

* fix e2e tests

* fix more e2e tests

* one more try

* 0.14.10 works

* one more try

* flippign exp

* flipping tihngs around

* fixing parallel e2e tests
2021-05-14 10:00:48 -07:00
Sarvar Muminov
805e94e7f6 Update conftest version to 0.25.0. (#1579)
Version 0.25.0 solves OOM issue described in [556](https://github.com/open-policy-agent/conftest/pull/556).
2021-05-13 14:05:06 -07:00
Marius Hennecke
40ffdd144f fix: use git diff for modified files, fixes #1397 (#1568) 2021-05-11 19:37:07 -04:00
Marc Barlo
ce57344b0e Nil pointer dereference when userConfig.DisableRepoLocking is true (#1557)
* init applyLockingClient when repo locking is disabled

* move applyingLockingClient init out
2021-05-10 19:53:35 -04:00
Marc Barlo
d98474a4aa Fix ParallelPlan and ParallelApply out of order in buildProjectCommandCtx (#1574)
* Fix regression - paralle plan / apply out-of-order

* Add test to check we're correctly setting ParallelPlan/Apply

* Add project command builder tests to check args

* rm vendor
2021-05-10 19:33:21 -04:00
Istvan Tapaszto
429235d40a DeleteSourceBranchOnMerge issue fixed (#1560) 2021-05-10 14:42:12 -04:00
Dogers
bc2b390431 Update Terraform 0.11.14 version to latest 0.11.15 (#1564)
* Update Docker file to 0.11.15 for PGP issue

* Update other references to TF 0.11 to latest 0.11.15
2021-05-10 13:58:36 -04:00
Marius Hennecke
1777be406e Get modified Azure DevOps PR files from commit and changes API endpoint (#1521)
* get modified ado pr files from commit and changes endpoint, fixes #1397

* Add missing error handling
2021-05-05 17:35:20 -04:00
Nish Krishnan
79309ed39c [ORCA-559] Fix hide previous command logic (#37) (#1549) 2021-05-03 12:47:23 -07:00
Nish Krishnan
9b28e8e940 Add extra args support to policy check step runner. (#1543)
* Add extra args support to policy check step runner.

* Fix tests/mocks.

* Update docs.
2021-04-30 14:37:54 -07:00
Luke Kysow
a597bbbb5a Regen mocks with latest pegomock and update scripts (#1524)
* Update go-generate to run as a script

It was taking forever to run via the previous Makefile command. I don't
exactly know why. Perhaps because it was passing all the packages in as
multiple arguments?

Either way, this change allows it to actually run through in about 20
minutes.

* Regenerate all mocks using latest pegomock

Pegomock version v2.9.0

* Format mocks outside of regular mocks directory.

These mocks are outside of the regular directory due to an import cycle
causing us to have to have these not under a /mocks directory so they
need to be formatted since they're not excluded.

* Add back make test target
2021-04-23 09:26:35 -07:00
Sarvar Muminov
f0201e9eb7 Upgrade conftest version to 0.23 (#1516)
* Upgraded conftest to 0.23.0 and removed --all-namespaces flag (#62)

* Upgraded conftest to 0.23.0 and removed --all-namespaces flag

* fix tests

* fix conftest version name

* make tests pass

* Update e2e tests to use 0.23 conftest

* Fix log function

* Make test client fetch version synchronously.

* Update fixtures.

* Pinning test image

Co-authored-by: Nish Krishnan <nishk@lyft.com>
2021-04-22 20:21:17 -07:00
Istvan Tapaszto
632460b20b Delete source branch on merge (#1357)
Co-authored-by: Tapaszto, Istvan <istvan.tapaszto@msciintegration.onmicrosoft.com>
2021-04-22 09:54:18 -07:00
Brian Zoetewey
f290780b61 feat: Add --autoplan-file-list server flag. (#1475)
* Add `--autoplan-file-list` server flag to allow modifying the list of files that trigger planning.

* Set default value for `--autoplan-file-list` and add `terragrunt.hcl` to the list.

* Default is handled in server now. No need for it here.

* Fix syntax error test.

* Fix e2e tests
2021-04-22 09:48:40 -07:00
Wojciech Krysmann
0886b280f9 Add plan summary to unfolded part of comment (#1518) 2021-04-22 09:14:44 -07:00
Dylan Page
25103d72f4 feat: add new flag --silence-no-projects (#1469)
* feat: add new flag --silence-no-projects

* refactor: add tests, clean up command_runner logic

* fix: attempt at fixing PolicyCheck e2e test

* docs: add silence-no-projects flag to server-configuration.md

* docs: fix grammar

* fix: requested changes: commit status resets, misc fixes

* fix: status check comments to actually reflect their commands

* fix: logic bug in autoplan commit reset

* fix: tests make check-lint errors
2021-04-19 14:52:56 -07:00
Nish Krishnan
df106ded11 Make policy checks its own apply requirement. (#61) (#1499)
* Make policy checks its own apply requirement. (#61)

* Remove warning from docs.
2021-04-13 12:46:47 -07:00
Nish Krishnan
7ac8106f8a Add structured logger (#54) (#1467)
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.
2021-04-06 12:02:25 -07:00
Sarvar Muminov
ad76385c76 Global atlantis lock new release branch (#1473)
* Orca 679 global atlantis lock new release branch (#49)

* Adding CommandLocker to boltDB and exposing it through locker interface

* Apply lock ui and apply command lock controller

* Minor comments

* Adding more tests and refactorinng

* Linting fixes

* creating applyLockingClient variable to fix interface error

* nullsink for stats

* Addressing PR comments

* fixing e2e tests

* linting fix fml

* Update outdated function descriptions

Address PR comments

* revert stats sink changes

* remove unnecessary dependencies
2021-04-01 15:40:29 -07:00
Mathieu Cantin
71a5dec88d Remove refreshing state 3e (#1433)
* fix(output): Remove Refreshing state... from output

Since Terraform 0.14.0 there are no separator between refreshing plan and the plan.
2021-03-10 12:18:10 -08:00
laurent apollis
d2ef2775c8 Support regexp in command builder on the project name (#1419) 2021-03-05 16:13:23 -08:00
Nish Krishnan
374e826393 Revert "fix(output): Remove Refreshing state... from output (#1352)" (#1431)
This reverts commit 7301febcb4.
2021-02-25 09:35:52 -08:00
Mathieu Cantin
7301febcb4 fix(output): Remove Refreshing state... from output (#1352)
* fix(output): Remove Refreshing state... from output

Since Terraform 0.14.0 there are no separator between refreshing plan and the plan.

* Fix comment typo
2021-02-25 08:34:35 -08:00
Dalton Hubble
00a5bc0fc0 Add a branch regex matcher to the server side repo config (#1383)
* Add a branch regex to the repo.yaml config to allow Atlantis to
accept only pull requests with a given base branch (the branch
a PR would merge _into_).
* `branch` is optional. By default its unset and Atlantis will match
webhooks for pull requests for any branch (no change)

Match any PR,

```
repos:
  - id: /.*/
    branch: /.*/
```

Match only PRs with master or main base branch.

```
repos:
  - id: /.*/
    branch: /(main|master)/
```

Some repos have special pull request branching practices. For example,
plan/apply from feature branches merging into master, but separate flows
for merging master into a release branch (where Atlantis isn't used).
Adding a regex allows for flexible workflow options. For example, you
could have Atlantis ignore "release" branches.
2021-02-24 12:52:30 -08:00
Gábor Lipták
832afeaec1 Correct typo (#1424) 2021-02-23 17:04:35 -05:00
Gábor Lipták
ec84dc861f Correct typo (#1425) 2021-02-23 17:04:07 -05:00
myoung34
a6e5c16608 Feature: Add HEAD_COMMIT env var (#1392) 2021-02-22 21:47:00 -08: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
Nish Krishnan
10d7b282e8 Fix e2e test fixtures for tf0.14. (#1396) 2021-02-10 16:48:35 -08:00
Marc Goujon
434b4f5074 Fixed bug in allowed_workflows logic (#1377) 2021-01-30 20:32:10 -08:00
Mihai Plasoianu
2c4e0c3409 Set TF_WORKSPACE env var (#1363) 2021-01-28 11:56:08 -08:00
Radon Rosborough
63a6e6450e Pass atlantis/apply when there are no plans (#1323) 2021-01-28 10:45:57 -08:00
Thomas Lacroix
6dfa6d55b5 fix(slack): replace slack GetChannels by GetConversations (#1350) 2021-01-28 10:37:01 -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
Istvan Tapaszto
68e20b1dc1 Fixing AutoMerge issue with Azure DevOps (#1289)
* Getting Azure DevOps user id on the fly

* mcdafydd/go-azuredevops module version increased

* Additional errorhandling

* Additional errorhandling Part2

* Doc update:  Access permission requirement

* Fixing modules.txt

* Fixing modules.txt

* Modules.txt fixed

* AzureDevops dependencies committed to vendor

* Fixing AzureDevOpsClient tests

* Fixing invalid bitbucket references in docs

* Fixing modules.txt

* Fixing go.mod

Co-authored-by: Tapaszto, Istvan <istvan.tapaszto@msciintegration.onmicrosoft.com>
2021-01-13 09:01:06 -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
Matija Buriša
43fce15076 add a valid variable definition file extension to list of exceptions (#1331)
* add a valid variable definition file extension to list of exceptions

* run go fmt

Co-authored-by: Matija Burisa <Matija.Burisa@infobip.com>
2021-01-04 12:08:50 -08:00
Alex Castle
d827f2c1d5 chore: correct cast from int to string in error message formating (#1327) 2020-12-22 10:29:22 -05:00
Sarvar Muminov
3456dc934b Add pre workflow custom hooks to run scripts before workflow execution(plan, apply, etc) (#1255)
* Updated runatlantis.io/docs to have `pre-workflow-hooks` use cases and examples
2020-12-14 15:19:52 -05:00
Marc Goujon
5a1e19155d Added support for restricting workflows usage repo-side (#1099)
* Added the ability to restrict server-side workflows on a per repo basis

* Fixed documentation broken links

* Removed unneeded
2020-12-14 10:37:37 -08:00
Laura Martin
b6e8403688 Use regex to filter filenames (#1253)
I ran into an issue where I have a directory of templates I use that I
name `foo.tf.template`. I found that Atlantis was running against this
directory and failing, which was unexpected behaviour.

This is because we're just checking if `.tf` is contained within a
filename, rather than checking if it's the suffix of the filename.

Instead, we can use regex to ensure that we're only filtering on actual
Terraform files, inclusive of `.tf` and `.tfvars` suffixes.

There are obviously some alternative ways I could get around this:
rename my templates to `foo.template` without the `.tf`.

I also really liked the idea of a `.atlantisignore` file previously
cited[1], but it was rejected in favour of explicitly defining exactly
which directories to run it in. We have a large number of directories so
this wasn't appealing to me.

I felt this behaviour was sufficiently unexpected that it was worth
making a more explicit filter.

[1] https://github.com/runatlantis/atlantis/issues/26
2020-12-12 21:18:40 -05:00
chenrui
d51a4706b3 chore(deps): sprig 3.1.0 (#1313)
* chore(deps): sprig 3.1.0

Signed-off-by: Rui Chen <rui@meetup.com>

* go mod vendor

Signed-off-by: Rui Chen <rui@meetup.com>
2020-12-12 21:05:15 -05:00
Alex Castle
8d921a7dc7 Fix >= 0.12.0 version detection for versions with prereleases 2020-12-03 23:20:44 -05:00
Nish Krishnan
1513089988 Merge pull request #1238 from lyft/fix-for-1236
Ensure that refreshed creds are used to update remote.
2020-12-02 16:39:02 -05:00
Gerald Barker
9a0cfd3c53 Set ApplyDisabled on CommentParser to fix help output 2020-11-01 22:58:11 +00: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