Commit Graph

34 Commits

Author SHA1 Message Date
Luke Massa
6cad7e6482 chore: Remove settings for require approval, mergeable, undiverged (#4047)
* Remove settings for require approval, mergeable, undiverged

* Fix
2023-12-27 16:11:45 +00:00
Luke Massa
d643c521ab feat: Remove flag for allow repo config (#3911)
* Remove option to allow repo

* Fix internal test

* Fix fmt

* Fmt

* Fix rebase

---------

Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
Co-authored-by: Dylan Page <dylan.page@autodesk.com>
2023-12-12 03:24:38 +00:00
Daniel Martins
95c5fe0fb3 fix: Enforce policy checks for overridden apply reqs (#3960)
* Enforce policy checks for overriden apply reqs

* Another take on the fix

This new version only includes the 'policies_passed' req back if
policy checks are enabled for the project.

* Fix test

* Fix comment

* Fix spelling

---------

Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
2023-12-11 21:48:23 -05:00
Luay-Sol
f79ece8243 feat: Add project depends on functionality (#3292)
* feat: implemented the code for the depends on functionality

Co-authored-by: Vincent <106497818+vincentgna@users.noreply.github.com>
2023-12-11 12:43:34 -08:00
jskrill
00aae565b2 feat: add autodiscover enabled feature (#3895)
* add flag to allow the user disable the autodiscover

* add global config and doc

* feat: Implement autodiscover.mode

* fix: Minor doc fixes

* fix: Small fixes to docs/indent/tests

* fix: Line length, quoting, function comments

* fix: Add a few more tests and remove newlines

* fix: Always camel case never snake

---------

Co-authored-by: Marcelo Medeiros <m.medeiros@carepay.com>
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
2023-11-29 15:43:53 -08:00
PePe Amengual
d083aa119f Revert "feat: Add project depends on functionality (#3821)" (#3825)
This reverts commit cf2b7911f4.
2023-10-06 11:35:38 -04:00
Brett Galkowski
22060fe5d2 feat: Add option allowing usage of custom policy check tools (#3765)
* Adding new flag everywhere relevant, implementing policy result workaround

* Fixing unit test str matching, adding custom policy conditional to step_runner

* Adding documentation steps for custom policy tools

* Refactoring ConftestOutput attribute to PolicyOutput
2023-10-06 10:57:29 -04:00
Vincent
cf2b7911f4 feat: Add project depends on functionality (#3821)
* feat: implemented the code for the depends on functionnality

* chore: Address PR comments

---------

Co-authored-by: Luay-Sol <luay.grira@solace.com>
2023-10-06 10:10:40 -04:00
Simon Heather
64f7d2e1a1 feat: Add Targeted Execution to the Pre/Post Workflow Hooks (#3708)
* Add Workflow hook target filter

* Fix post workflow hook example

* Update WokrflowHook in global_cfg

* Fix linting

---------

Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
2023-10-06 09:37:07 -04:00
Shouichi Kamiya
2bd778b01e fix: auto plan when .terraform.lock.hcl changed (#3473)
Problem

When `projects` are specified and `when_modified` is not specified via
the config file, changing `.terraform.lock.hcl` file won't trigger auto
plan. This is because the default `raw.WhenModified` does not include
`.terraform.lock.hcl`.

Note that when projects are auto detected, changing
`.terraform.lock.hcl` triggers auto plan. This is because the
`cmd.DefaultAutoplanFileList` includes `.terraform.lock.hcl`.

Solution

Include `.terraform.lock.hcl` to the default `raw.WhenModified`.
2023-07-31 11:29:33 -04:00
Simon Heather
b8994190be feat: Add Support for Customising the Shell for Pre and Post Workflow Hooks (#3451) 2023-07-07 18:34:01 -04:00
Ross Strickland
76c482b83a feat: global repo params (#3379) 2023-07-07 18:33:21 -04:00
Andre Ziviani
974eed3803 feat: Disable policy check on some repositories (#3503)
* feat: Allow enabling policy check per repository

* chore: Tests

* chore: Docs

* chore: Improve tests

* chore: E2E tests
2023-07-06 16:39:36 -04:00
Yunchi Luo
a6161c9926 feat: Add an output option to filter output for custom run steps (#3518)
* feat: Add an `output` option to filter output for custom run steps
2023-06-30 10:00:31 -04:00
Ken Kaizu
3954955e13 fix(deps): update module github.com/petergtz/pegomock/v3 to v4 (#3534)
* fix(deps): update module github.com/petergtz/pegomock/v3 to v4 in go.mod

* remove pegomock generate m option, which is not support after v4

* make regen-mocks

* replace pegomock v4 primitive eq/matchers

* convert pegomock v4 Eq/Any matchers

* remove custom models.Repo matcher

* pegomock v4 cannot use result method args

ref https://github.com/petergtz/pegomock/issues/123

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-20 15:05:23 -04:00
oysteingraendsen
4e867fc36e feat: when using order group, abort plan/apply if any fail (#3323)
* feat: when using order group, abort plan/apply if any fail

* feat: add 'abort_on_execution_order_fail' flag on repo level

* feat: use runProjectCmdsParallelGroups in version_command_runner

* chore: add plan tests

---------

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
2023-05-12 13:24:33 -04:00
Marcus Ramberg
f8b293ada0 feat: Github reaction emojis on PR comments (#2706)
* feat: Basic implementation of github reactions on PRs

Adds eyes whenever it detects an `atlantis` command.

* feat: Make the emoji reaction configurable

* tests: Add a mocked test for EmojiReaction being called in github

* ci: Disable revive linter for stubs
2023-04-25 17:22:51 -04:00
Ross Strickland
684f2fa7e0 feat(policies): Add granular policy_sets (#3086)
* Initial work.

* Periodic push.

* Fmt and start adding args to approve_policies cmd.

* keep funcs for now.

* Periodic push.

* Periodic push.

* fmt.

* Move approve policies logic to project_command_runner.

* update some tests

* More test fixes.

* update more tests. fix som logic.

* more tests. add additional info to common data for custom templates.

* fix apply with policies bug. update more tests/fmt

* file perms

* fix error parsing for conftest results.

* Update more tests and linting.

* update documentation.

* Address no-fail case. Address comments.

* Forgot changes.

* fix markdown renderer

* Fix policy fail logic. remove uneeded tmpl var

* targeted policy approvals fix

* Address PR comments.

* empty commit to trigger build

---------

Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
Co-authored-by: rkstrickland <ross.strickland@instacart.com>
Co-authored-by: Dylan Page <dylan.page@autodesk.com>
2023-04-20 21:53:46 -04:00
Ken Kaizu
930daef300 chore: remove x package (#3085) 2023-01-31 08:28:28 -06:00
Ken Kaizu
75c4c1fdcf fix(deps): update module github.com/go-redis/redis/v9 to v9.0.1 (#3075) 2023-01-30 23:36:30 -06:00
Luke Young
5d47eeb63b feat: add plan_requirements capability (#2979)
* Add plan_requirements

* Pass pull request fetcher down to plan runner

* Adding tests

* Replace sliceContainsF with slice.Contains

* Remove policy check for plan

Co-authored-by: Casey Miller <camiller@confluent.io>
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
Co-authored-by: Casey Miller <47993553+camillsir@users.noreply.github.com>
2023-01-21 00:20:04 -06:00
Ken Kaizu
cb0aadf571 feat: state rm (#2880)
* 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
2023-01-18 22:02:18 -06:00
Darren Worrall
7746655eb1 Support team owners for policies (#2953) 2023-01-10 16:53:05 -06:00
Ken Kaizu
4e0d4ecc40 feat: atlantis import (#2783)
* feat: atlantis import

* feat: atlantis import

* regenerate mock comment builder

* remove duplicate err check

* instrumented import command runner/builder

* atlantis import subcommand accept args before hyphen

* fix link checker

* docs: review feedback

* fix atlantis import options order

* Update runatlantis.io/docs/using-atlantis.md

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update runatlantis.io/docs/using-atlantis.md

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update runatlantis.io/docs/using-atlantis.md

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update runatlantis.io/docs/using-atlantis.md

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update runatlantis.io/docs/using-atlantis.md

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update runatlantis.io/docs/command-requirements.md

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update runatlantis.io/docs/command-requirements.md

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update runatlantis.io/docs/command-requirements.md

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update server/events/comment_parser.go

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update server/events/comment_parser.go

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update runatlantis.io/docs/command-requirements.md

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update runatlantis.io/docs/command-requirements.md

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update runatlantis.io/docs/command-requirements.md

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update runatlantis.io/docs/server-side-repo-config.md

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update runatlantis.io/docs/command-requirements.md

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update runatlantis.io/docs/command-requirements.md

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update runatlantis.io/docs/command-requirements.md

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update runatlantis.io/docs/command-requirements.md

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update runatlantis.io/docs/command-requirements.md

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update server/events/command_requirement_handler.go

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Update server/events/command_requirement_handler_test.go

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* fix test import usage

* fix e2e expected txt

* fix doc link

* docs: workflow import stage/step

* docs fixup

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
2022-12-22 18:37:29 -06:00
Fabiano Soares Honorato
cb485f11ee feat: Add pre and post workflow hook status (#2441)
* 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>
2022-12-19 14:20:34 -06:00
Ken Kaizu
08e9c5a17e feat: customize atlantis.yaml file name in server side config (#2798)
* feat: customize atlantis.yaml file name in server side config

* Update server/events/vcs/bitbucketcloud/client.go

* Update server/events/vcs/bitbucketserver/client.go

* Update server/events/vcs/not_configured_vcs_client.go

* Update server/events/vcs/azuredevops_client.go

* docs: repo_config_file multiple atlantis servers usecase example

* docs: multiple atlantis server usage which show how to call one atlantis server

* Update runatlantis.io/docs/server-side-repo-config.md

* Apply suggestions from code review

* Update runatlantis.io/docs/server-side-repo-config.md

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
2022-12-18 23:02:38 -06:00
Ken Kaizu
4d957836ad Enable or disable repo_locking per repo in repos.yaml and atlantis.yaml (#2700)
* 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>
2022-12-09 16:13:31 -06:00
nitrocode
d85662cdf1 Rename default branch to main (#2662)
* Rename default branch to main

* Bump git, curl, and openssl packages
2022-11-14 11:28:29 -06:00
Eng Zer Jun
49c5eba458 test: use T.TempDir to create temporary test directory (#2671)
This commit replaces `os.MkdirTemp` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `os.MkdirTemp`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-11-13 14:13:29 -06:00
Anton Bronnikov
4cacaeb0c7 Implement branch matching in repo-level config (#2522) 2022-11-08 22:08:20 -08:00
Andrey Vydrin
569031ab23 feat: add execution order group (#2178)
* feat: add execution order group

to apply/plan by order

* fix: use official golanci-lint script
2022-06-29 12:01:54 -07:00
Steve Yoon
e90aa575e0 feat: Prometheus metrics support (#2204)
* support prometheus metrics

* remove redundant error checking

* load prometheus metrics config

* dynamic separator for subscopes

* removing unnecessary config file

* adding a few more metrics test cases

* remove testing handler

* fix upstream merge error
2022-06-28 08:58:15 -07:00
Nish Krishnan
d1d1539ced feat: Add stats support for basic operations (#2147) 2022-03-18 15:18:13 -07:00
Sarvar Muminov
7a927c050b Moving config files to core/config (#2036)
* Moving config files to core/config

* fix package names

* fix package dependencies

* linting fixes

* more linting fixes

* ran golangci-lint run --fix
2022-02-03 11:06:04 -08:00