forked from runatlantis/atlantis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Disable policy check on some repositories (runatlantis#3503)
* feat: Allow enabling policy check per repository * chore: Tests * chore: Docs * chore: Improve tests * chore: E2E tests
- Loading branch information
1 parent
163c5e9
commit 974eed3
Showing
61 changed files
with
1,254 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...ontrollers/events/testdata/test-repos/policy-checks-disabled-previous-match/atlantis.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
version: 3 | ||
projects: | ||
- dir: . | ||
workspace: default |
3 changes: 3 additions & 0 deletions
3
...nts/testdata/test-repos/policy-checks-disabled-previous-match/exp-output-apply-failed.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Ran Apply for dir: `.` workspace: `default` | ||
|
||
**Apply Failed**: All policies must pass for project before running apply. |
12 changes: 12 additions & 0 deletions
12
...ers/events/testdata/test-repos/policy-checks-disabled-previous-match/exp-output-apply.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Ran Apply for dir: `.` workspace: `default` | ||
|
||
```diff | ||
null_resource.simple: | ||
null_resource.simple: | ||
|
||
Apply complete! Resources: 1 added, 0 changed, 0 destroyed. | ||
|
||
Outputs: | ||
|
||
workspace = "default" | ||
``` |
5 changes: 5 additions & 0 deletions
5
...testdata/test-repos/policy-checks-disabled-previous-match/exp-output-approve-policies.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Approved Policies for 1 projects: | ||
|
||
1. dir: `.` workspace: `default` | ||
|
||
|
29 changes: 29 additions & 0 deletions
29
...estdata/test-repos/policy-checks-disabled-previous-match/exp-output-auto-policy-check.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Ran Policy Check for dir: `.` workspace: `default` | ||
|
||
**Policy Check Failed**: Some policy sets did not pass. | ||
#### Policy Set: `test_policy` | ||
```diff | ||
FAIL - <redacted plan file> - main - WARNING: Null Resource creation is prohibited. | ||
|
||
1 test, 0 passed, 0 warnings, 1 failure, 0 exceptions | ||
|
||
``` | ||
|
||
|
||
#### Policy Approval Status: | ||
``` | ||
policy set: test_policy: requires: 1 approval(s), have: 0. | ||
``` | ||
* :heavy_check_mark: To **approve** this project, comment: | ||
* `atlantis approve_policies -d .` | ||
* :put_litter_in_its_place: To **delete** this plan click [here](lock-url) | ||
* :repeat: To re-run policies **plan** this project again by commenting: | ||
* `atlantis plan -d .` | ||
|
||
--- | ||
* :heavy_check_mark: To **approve** all unapplied plans from this pull request, comment: | ||
* `atlantis approve_policies` | ||
* :put_litter_in_its_place: To delete all plans and locks for the PR, comment: | ||
* `atlantis unlock` | ||
* :repeat: To re-run policies **plan** this project again by commenting: | ||
* `atlantis plan` |
Oops, something went wrong.