-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Disable policy check on some repositories #3503
Conversation
@AndreZiviani - I was only able to take a quick look today. I'll try to give this a more thorough lookover tomorrow. Can you add an e2e test? |
@rkstrickland I wasn't sure where to add the tests, let me know if there is somewhere better and if those are enough |
484771f
to
34a46b7
Compare
@AndreZiviani - For e2e test, you'd want to add a cases here: https://github.com/runatlantis/atlantis/blob/main/server/controllers/events/events_controller_e2e_test.go#L816 Try to account for various conditions where policy check is enabled/disabled in opposing fashion between global and repo config. |
@rkstrickland I had a hard time figuring out how to run them (was trying to run the |
hey @rkstrickland just a friendly reminder to review this PR :) |
``` | ||
|
||
## Running policy check only on some repositories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i understand the changes correctly, the configuration could be denied explicitly globally and enabled on desired repos too, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct, in order to not break backwards compatibility you have to enable it globally (via --enable-policy-checks
) and exclude the repositories that you want
This change seems to make sense and appears to have good test coverage. |
d155e29
to
61024ac
Compare
i've been using this feature on my production for couple weeks now. seems good. |
Thank you for the contribution |
* feat: Allow enabling policy check per repository * chore: Tests * chore: Docs * chore: Improve tests * chore: E2E tests
* feat: Allow enabling policy check per repository * chore: Tests * chore: Docs * chore: Improve tests * chore: E2E tests
what
Allows the user to disable policy checking on some repositories
why
Policy checking is really usefull but sometimes we may want to disable it on some repositories, currently we would need a separate Atlantis instance for that
tests
Tested only some standard cases locally, will be running this change in our environment next week
references