Commit Graph

314 Commits

Author SHA1 Message Date
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
Simon Heather
1b45fb1ae1 fix: When GitHub/GitLab Auto-Merge Is Used with Atlantis Pre Workflow Hooks, the PR will be Merged Prematurely (#3880)
* Fix Premature Auto-Merge

* Add CommitStatusUpdater to commandRunner
2023-11-03 22:41:16 -04:00
Koen van Zuijlen
786e57c1d6 feat: Added disable-unlock-label config option (#3799)
* Added disable-unlock-label config option

* Fixed tests

* Wrote tests + fixed mistakes

* Added docs

* added defaults to docs

---------

Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
2023-10-10 11:02:26 -04:00
Ghais Zaher
80ecc38273 feat: disable autoplan label (#3649)
* feat: disable autoplan label

* documentation

* revert unrelated change

* fix property

* gitlab and github

* dd more test

* small fixes

* add tests for github and gitlab clients

* fix: remove unrelated comments

* fmt

---------

Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
2023-09-25 13:43:35 -04:00
wolmi
c35ba0d69f feat: Add use plugin cache flag (#3720)
* feat: Add use plugin cache bool flag

* feat: Added use-plugin-cache doc

* feat: refactor to reflect terrafrom in plugin cache flag

Co-authored-by: Simon Heather <32168619+X-Guardian@users.noreply.github.com>

* fix: missing closing in bash block documentation

* fix: typo in flag example

* feat: improve docs

* feat: performance implications documented

* feat: increase terraform minor version to 1.3.10

---------

Co-authored-by: Simon Heather <32168619+X-Guardian@users.noreply.github.com>
2023-09-22 14:42:58 -07:00
Simon Heather
cd7ae114eb feat: add ability to track git untracked files (#3724) 2023-09-11 10:57:50 -04:00
Simon Heather
dc644937cf feat: Add A Server Config Flag to Enable Failure on Pre Workflow Hook Errors (#3729)
* FailOnPreWorkflowHookError

* Fix linting issues
2023-09-01 10:17:10 -07:00
smstone
b8bb6df40a feat: Slack notifications matched on base branch name (#3644)
* Add ability to send slack notification matched on base branch name

* Update BranchRegex usage doc

* Add test with invalid branch and workspace regex
2023-08-22 15:13:00 +00:00
Tom Baker
a791fbfff6 feat: Add username to main lock screen (#3597)
* Add username to lock screen
2023-07-17 16:18:52 +00:00
Ross Strickland
76c482b83a feat: global repo params (#3379) 2023-07-07 18:33:21 -04:00
Simon Heather
91593b647b fix: Discarding a Plan Causes the Whole Working Directory to be Deleted (#3553) 2023-07-07 11:12:06 -04:00
Simon Heather
504d1b7fe3 Replace bindata-assetfs with embed (#3504)
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
2023-06-10 19:04:10 -05:00
nitrocode
79500182db chore(deps): bump tally to v4 (#3498) 2023-06-08 21:57:46 -04:00
Ross Strickland
ad75aace78 fix: Initialize VCSClient for commandrunner to remove recent server panics (#3461)
* Initialize VCSClient for commandrunner.

* Add test.
2023-05-30 14:32:37 -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
Jonathan Wiemers
8b90c8b0da feat: Rotate Github App Token outside of Atlantis commands (#3208)
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
2023-03-23 00:49:23 +00:00
Andrei Vydrin
f7f35ceb29 feat: add hide-unchanged-plan-comments option (#3158)
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
2023-02-25 15:50:33 -06:00
nitrocode
ad2274f114 feat: shallow repo clone in merge checkout strategy (#2758)
* Implement shallow repo clone in merge checkout strategy

---------

Co-authored-by: Ilya Lukyanov <il@joom.com>
Co-authored-by: Nikolai Røed Kristiansen <nikolaik@gmail.com>
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
Co-authored-by: Ken Kaizu <k.kaizu38@gmail.com>
2023-02-22 13:29:29 -08:00
Ken Kaizu
fdcb1adfb0 feat: suppress log package logging (#3076)
To suppress uber-go/tally logs which are not structured logs.
2023-01-30 23:55:01 -06:00
Adam Zahumenský
953de00f80 feat: --silence-no-projects to comments with -d and -p (#2969)
* Expand --silence-no-projects to targeted commands

* Cover other commands, test+docs

* Add more tests, refactor doc

* fix tests

* fix dangling pending VCS statuses

* fix: codeql yaml

* fix: lint
2023-01-24 08:26:24 -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
f8eba4bce6 fix: markdown renderer use invalid disableApply flag with disableMarkdownFolding (#3016) 2023-01-19 15:58:05 -08: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
Ken Kaizu
c77149396a fix: atlantis import on workspaces (#2937)
* atlantis import not works on workspace

* extract workspace_step_runner_delegate from plan_step_runner

* import step runner requires workspace delegate
2023-01-11 17:53:45 -06:00
Darren Worrall
7746655eb1 Support team owners for policies (#2953) 2023-01-10 16:53:05 -06:00
Ken Kaizu
ca507560f4 fix: set ctx.PullRequestStatus in import_command_runner for import_requirements (#2936)
* refactor: pull_status_fetcher contains vcsStatusName in struct / reduce FetchPullStatus parameter

* import_command_runner need to set ctx.PullRequestStatus for import_requirements
2023-01-08 10:22:33 -05:00
Ken Kaizu
46bf0466c0 fix: markdown renderer use ExecutableName instead atlantis (#2939)
* 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
2023-01-06 16:20:14 -06:00
Sebastian Poxhofer
a508bdb255 fix(discardApprovalOnPlan): add missing conditional and tests (#2913)
* 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>
2023-01-03 10:21:37 -06:00
Ken Kaizu
f09a9d4c01 feat: --allow-commands restricts available atlantis commands (#2877)
* 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
2022-12-27 22:52:39 -06:00
nitrocode
9345d55127 Upgrade negroni to v3 (#2867) 2022-12-23 11:58:10 -06:00
Ken Kaizu
b3d0847ac7 remove urfave/cli. this is introduced for cli.NewApp, but currently atlantis use cobra, so no meanings (#2866)
- 5f47524655/main.go (L51)
- 5f47524655
2022-12-23 08:17:08 -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
Adam Verigin
faa027acbd feat: Add flag to disable downloading tf for airgapped environments (#2843)
* 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
2022-12-22 13:37:35 -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
Fabiano Soares Honorato
6a7f79e749 Metrics initialization (#2767)
* Add builder metrics initialization

* Add pull_closed metrics initialization

* Add builder metrics initialization

* use InitCounter from metrics package to initialize prometheus counters
2022-12-16 22:22:06 -06:00
Ken Kaizu
8d74878f9d feat: customize vcs comment command executable name (#2805) 2022-12-16 19:16:36 -08: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
Fabiano Soares Honorato
66dc30e755 feat: prevent planning and applying directories outside PR scope using --restrict-file-list (#2440)
* Add --strict-plan-file-list config

* Update server.go

* Update server-configuration.md

* Update server_test.go

* Run gofmt -w

* Add --strict-plan-file-list for projects

* Add --strict-plan-file-list tests

* Change --strict-plan-file-list to --restrict-file-list

* Update --restrict-file-list documentation

* Update --restrict-file-list and --enable-regexp-cmd documentation

Co-authored-by: Fabiano Honorato <fabiano.honorato@ifood.com.br>
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
2022-12-09 09:33:40 -06:00
noah
61bcfbab2b feat: auto-plan projects when modules change (#2507)
* feat: auto-plan projects when modules change

Fixes #920

* rename Downstream->Dependent; docs cleanup

* chore: gofmt -s
2022-11-28 14:12:29 -08:00
Casey Miller
9b90f2e4f4 Adding reloading of TLS certificates (#2656)
* Adding reloading of TLS certificates

* Update server/server.go

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

* Adding test and test data

* Set minimum tls version

* Adding read header timeout

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
2022-11-14 12:49:34 -06:00
nitrocode
ec995dd794 Bump all dependencies (#2675)
* Bump all dependencies using go get -u

* Added nolint: gosec for writing git creds
2022-11-14 00:50:57 -06:00
Ross Strickland
d620d5de98 Add custom templating support (#2647)
* added custom templates support

* made default templates DRY

* Change init to anonymous function.

* Initialize anonymous function inside var

* - Add flag/cfg param for custom template dir
- Add test for custom template

* Add documentation.

* Address PR comments.

Co-authored-by: Ricard Bejarano <ribejara@thousandeyes.com>
2022-11-11 09:56:33 -06:00
Eirik Nygaard
5e3f1a9f90 Add argument for enabling same origin check for websocket connections (#2659)
* Add argument for enabling same origin check for websocket connections

* Remove else clause and outdent return

* Add unit test for websocket origin check
2022-11-11 09:50:15 -06:00
Marc Barlo
3bfd769211 feat: add a flag to silence policy checks comments when there's no error (#2405)
* 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
2022-10-26 23:35:49 -07:00
giuli007
2cd8bd9ccc Delete previous plans on autoplan or atlantis plan (#1633)
* 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>
2022-09-23 14:31:24 -07:00
Brian Zoetewey
1bcf938644 Adding Redis DB option (#2527)
* Adding Redis DB option
This allows selecting something other than the default database of 0.

* Add missing db argument to fix failing tests.
2022-09-20 21:27:16 -07:00
Daniel Thompson
d5d8e38117 Adding Redis TLS Option (#2510)
* Adding Redis TLS option

* Test fixes and allow for tls skip verify

* Test fixes and allow for tls skip verify
2022-09-09 20:02:26 -07:00
Daniel Thompson
ab2cdb833a External Locking DB: Redis (#2491)
* 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
2022-09-07 16:57:06 -07:00
Ray Terrill
89d33a0737 Make required atlantis/apply status check work with mergeable (#2436)
* 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
2022-08-18 09:46:50 -07:00