runatlantis / atlantis

Terraform Pull Request Automation
https://www.runatlantis.io
Other
7.75k stars 1.05k forks source link

QuietPolicyCheck outputs warning #3178

Open WJay-tec opened 1 year ago

WJay-tec commented 1 year ago

Community Note


Describe the user story We currently have a use case where WARNING is thrown for our OPA policies instead of ERROR. Based on the atlantis docs, only policy check errors will be outputted in the PR, would like to request for an option to also output warnings to the PR as well.

Describe the solution you'd like Have another flag that we can set for atlantis, that will allow QuitePolicyCheck to also output WARNING messages.

Describe the drawbacks of your solution None

Describe alternatives you've considered None

nitrocode commented 1 year ago

Agreed. I think instead of a flag, it should just show warnings by default.

Thanks for making a ticket. Please feel free to propose a PR. We'd be happy to review it

WJay-tec commented 6 months ago

@nitrocode sure i will try to take a stab at it!

nitrocode commented 6 months ago

This may have already been implemented by @pseudomorph in PR #3806.

Take a look at these code blocks

https://github.com/runatlantis/atlantis/blob/890df735887b6dbf19ea50241c378c34c617c15d/server/core/runtime/policy/conftest_client.go#L172-L248

https://github.com/runatlantis/atlantis/blob/890df735887b6dbf19ea50241c378c34c617c15d/server/core/runtime/policy/conftest_client.go#L300-L308

If you haven't checked, try upgrading your atlantis to the latest version to see if your issue is still applicable.