Commit Graph

34 Commits

Author SHA1 Message Date
Rui Chen
23b373e8a6 fix: add misspell check for linting codebase (#3865)
* add misspell check

* lint: fix misspell issues

```
server/events/vcs/instrumented_client.go:46:26: `soley` is a misspelling of `solely` (misspell)
// methods and implement soley any github specific interfaces.
                         ^
server/events/project_command_context_builder.go:49:5: `Conciously` is a misspelling of `Consciously` (misspell)
	// Conciously making this global since it gets flushed periodically anyways
	   ^
server/controllers/events/gitlab_request_parser_validator.go:87:32: `noteable` is a misspelling of `notable` (misspell)
				NoteableType string `json:"noteable_type"`
				                           ^
server/controllers/events/gitlab_request_parser_validator_test.go:351:6: `noteable` is a misspelling of `notable` (misspell)
    "noteable_type": "MergeRequest",
     ^
server/controllers/events/gitlab_request_parser_validator_test.go:359:6: `noteable` is a misspelling of `notable` (misspell)
    "noteable_id": 7,
     ^
server/controllers/events/gitlab_request_parser_validator_test.go:467:6: `noteable` is a misspelling of `notable` (misspell)
    "noteable_type": "Commit",
     ^
server/controllers/events/gitlab_request_parser_validator_test.go:475:6: `noteable` is a misspelling of `notable` (misspell)
    "noteable_id": null,
     ^
server/events/event_parser_test.go:1012:23: `seperate` is a misspelling of `separate` (misspell)
	// If sha changes in seperate PR,
	                     ^
```

Signed-off-by: Rui Chen <rui@chenrui.dev>

* add locale setting

Signed-off-by: Rui Chen <rui@chenrui.dev>

* Revert "lint: fix misspell issues"

This reverts commit 7cc56afa8e.

* lint: fix some misspell issues

Signed-off-by: Rui Chen <rui@chenrui.dev>

---------

Signed-off-by: Rui Chen <rui@chenrui.dev>
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
2023-10-16 20:17:57 +00: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
ec77a951b0 chore: Fix Go Static Check Errors (#3637)
* Fix Go Static Checks

* Fix working dir tests
2023-08-05 16:41:54 -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
nitrocode
79500182db chore(deps): bump tally to v4 (#3498) 2023-06-08 21:57:46 -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
Ross Strickland
434bab5c70 [Feature] - Add clear policy approval functionality. (#3351)
* Add clear policy approval functionality.

* Fix param name, update doc.

* fix test, add e2e test

* empty commit to re-trigger tests.

---------

Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
2023-05-02 11:02:04 -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
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
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
9a38e35493 bugfix: Initialize metrics with empty tags (#2847)
* Initialize metrics with empty tags

* Better name for Project tags

* No need for dedicated set scope tags on metrics
2022-12-21 12:36:44 -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
FBLGit
f8b1ea9b88 Detect terraform versions using >= and ~> specifiers (#1776)
* Refactor TFVersion from Dir with tfswitch lib

* Added tests and cleaned up code

* linted fmtd

* fixed conflict go.mod

* bumped to tf1.0.6

* bumped go.mod

* Update project_command_context_builder.go

* Bump warrensbox/terraform-switcher

* Fix tests

* rm redundant mocks library import

Co-authored-by: xmurias <xmurias@gmail.com>
Co-authored-by: Xavier <77047592+xavipanda@users.noreply.github.com>
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
2022-11-20 21:27:17 -06:00
Alberto Rojas
949ee3fa5f metrics: Add Metrics tags to multiple Scopes (#2687)
* metrics: Add Metrics tags to multiple Scopes

* metrics: Fix base_repo and pr_number

* metrics: Refactor SetScope to SetScopeTags

* metrics: Add SetGitScopeTags function

* metrics: docs reword project_context SetScopeTags description

* metrics: test Add TestNewScope_PrometheusTaggingCapabilities
2022-11-19 08:31:46 -06: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
Sarvar Muminov
90e92e3a13 chore: move CommandContext and CommandResult to models (#193) (#2093)
* Moved CommandContext and CommandResult to models (#193)

* Moved CommandContext and CommandResult to models

* move from models to command

rename CommandContext -> Context
rename CommandResult -> Result

* moved command related helpers into command package

* move ProjectCommandContext and ProjectResult to command/project package

* move project command context and project result

* revert unrelated code

* move tests

* fix left over

* fix linting

* fix tests

* remove unused import

* fix project context dependencies

* fix depenedecies

* fix typo
2022-03-21 10:36:13 -07:00
Nish Krishnan
d1d1539ced feat: Add stats support for basic operations (#2147) 2022-03-18 15:18:13 -07:00
Aayush Gupta
58e9b42bbc feat: Use UUIDs to identify log streaming jobs (#2051)
* Add UUID for Log Streaming Job ID (#167)

* Update log handler to close buffered  channels when an operation is complete (#170)

* Add preliminary check before registering new receivers in the log handler (#173)

* Using projectOutputBuffers to check for jobID instead of receiverBuffers (#181)

* Refactor log handler  (#175)

* Reverting go.mod and go.sum

* Fix lint errors

* Fix linting
2022-02-09 13:15:49 -08: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
Nish Krishnan
33b4d6325a refactor: Add PullStatusFetcher interface (#1904) 2021-11-18 11:42:36 -08:00
Sarvar Muminov
a2d82b9f45 Set ParallelPolicyCheckEnabled to the same value as ParallelPlanEnabled (#1802) 2021-09-09 09:21:26 -07:00
Pat Sier
d358857e80 feat: add version command (#1691) 2021-07-12 11:10:15 -04:00
Sarvar Muminov
0ed7a43e59 Fix policy check loading the tf version (#1658) 2021-06-23 11:48:55 -07:00
Sarvar Muminov
7607c154cb revert previous commit 2021-06-23 11:30:07 -07:00
Sarvar Muminov
3b08952168 Load terraform version from the required_version block 2021-06-23 11:24:55 -07:00
Spiros Economakis
e48f80359b Add an extra flag to disable automerge with comment apply (#1533)
```
atlantis apply --auto-merge-disabled
```

Issue: #1245
2021-06-22 09:33:07 -07: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
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
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
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