Skip to content

Commit

Permalink
feat: Better message on policy failure
Browse files Browse the repository at this point in the history
Include the specific command `approve_policies` in the message.
  • Loading branch information
dupuy26 committed Nov 15, 2021
1 parent 7d6a0a9 commit af923cf
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ FAIL - <redacted plan file> - main - WARNING: Null Resource creation is prohibit
1 test, 0 passed, 0 warnings, 1 failure, 0 exceptions

```
* :heavy_check_mark: To **approve** failing policies either request an approval from approvers or address the failure by modifying the codebase.
* :heavy_check_mark: To **approve** failing policies an authorized approver can comment:
* `atlantis approve_policies`
* :repeat: Or, address the policy failure by modifying the codebase and re-planning.


Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ FAIL - <redacted plan file> - main - WARNING: Null Resource creation is prohibit
1 test, 0 passed, 0 warnings, 1 failure, 0 exceptions

```
* :heavy_check_mark: To **approve** failing policies either request an approval from approvers or address the failure by modifying the codebase.
* :heavy_check_mark: To **approve** failing policies an authorized approver can comment:
* `atlantis approve_policies`
* :repeat: Or, address the policy failure by modifying the codebase and re-planning.


Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ FAIL - <redacted plan file> - null_resource_policy - WARNING: Null Resource crea
1 test, 0 passed, 0 warnings, 1 failure, 0 exceptions

```
* :heavy_check_mark: To **approve** failing policies either request an approval from approvers or address the failure by modifying the codebase.
* :heavy_check_mark: To **approve** failing policies an authorized approver can comment:
* `atlantis approve_policies`
* :repeat: Or, address the policy failure by modifying the codebase and re-planning.


Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ FAIL - <redacted plan file> - main - WARNING: Forbidden Resource creation is pro
1 test, 0 passed, 0 warnings, 1 failure, 0 exceptions

```
* :heavy_check_mark: To **approve** failing policies either request an approval from approvers or address the failure by modifying the codebase.
* :heavy_check_mark: To **approve** failing policies an authorized approver can comment:
* `atlantis approve_policies`
* :repeat: Or, address the policy failure by modifying the codebase and re-planning.


---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ FAIL - <redacted plan file> - main - WARNING: Null Resource creation is prohibit
1 test, 0 passed, 0 warnings, 1 failure, 0 exceptions

```
* :heavy_check_mark: To **approve** failing policies either request an approval from approvers or address the failure by modifying the codebase.
* :heavy_check_mark: To **approve** failing policies an authorized approver can comment:
* `atlantis approve_policies`
* :repeat: Or, address the policy failure by modifying the codebase and re-planning.


5 changes: 3 additions & 2 deletions server/events/markdown_renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,9 @@ var unwrappedErrTmplText = "**{{.Command}} Error**\n" +
"{{.Error}}\n" +
"```" +
"{{ if eq .Command \"Policy Check\" }}" +
"\n* :heavy_check_mark: To **approve** failing policies either request an approval from approvers or address the failure by modifying the codebase.\n" +
"{{ end }}"
"\n* :heavy_check_mark: To **approve** failing policies an authorized approver can comment:\n" +
" * `atlantis approve_policies`\n" +
"* :repeat: Or, address the policy failure by modifying the codebase and re-planning.{{end}}"
var wrappedErrTmplText = "**{{.Command}} Error**\n" +
"<details><summary>Show Output</summary>\n\n" +
"```\n" +
Expand Down

0 comments on commit af923cf

Please sign in to comment.