Skip to content
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

Bug: Running apply twice bypasses policies #3138

Closed
pseudomorph opened this issue Feb 15, 2023 · 2 comments · Fixed by #3086
Closed

Bug: Running apply twice bypasses policies #3138

pseudomorph opened this issue Feb 15, 2023 · 2 comments · Fixed by #3086
Labels
bug Something isn't working

Comments

@pseudomorph
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

Running either atlantis apply or a targeted apply twice on a PR which has failing policies results in the project(s) being applied.

Reproduction Steps

1.) Open PR which contains changes that result in failing policies.
2.) Get the PR into a mergeable state.
3.) Run an apply command twice. Any of the following should work.

  • atlantis apply, then atlantis apply
  • apply, then targeted apply
  • 2 targeted applies

Screen Shot 2023-02-15 at 1 52 55 PM

Looks like requirement checker is checking for errored policy status on the project: https://github.com/runatlantis/atlantis/blob/main/server/events/command_requirement_handler.go#L50

But when the apply fails after this requirement check, the project status is shifted to failed apply: https://github.com/runatlantis/atlantis/blob/main/server/events/command/project_result.go#L53

Logs

Environment details

Additional Context

@pseudomorph pseudomorph added the bug Something isn't working label Feb 15, 2023
@pseudomorph pseudomorph changed the title Running apply twice bypasses policies Bug: Running apply twice bypasses policies Feb 15, 2023
@nitrocode
Copy link
Member

Good find! Please feel free to propose a PR. We need more eyes on this stuff :)

@pseudomorph
Copy link
Contributor Author

I've tacked on a fix to the granular policy sets PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants