runatlantis / atlantis

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

Azure DevOps: Policy check fails sporadically #1043

Open jpreese opened 4 years ago

jpreese commented 4 years ago

If there are failed policies associated with a PR, we've seen cases where Atlantis will allow the apply operation to go through anyway.

The theory on this is that when using the Policy API, the status of the policy can be stale. We will continue to monitor the behavior, but we may need to requeue policy the check before looking at the result.

lkysow commented 4 years ago

What do you mean by requeue the policy check?

jpreese commented 4 years ago

I have not personally experienced this problem, but a couple coworkers have reported that Atlantis doesn't always respect the pull request policy.

My current assumption is that when you call the endpoint to get the current status of the policy, that it isn't up to date and needs to be requeued-- as I do see a requeue endpoint. https://docs.microsoft.com/en-us/rest/api/azure/devops/policy/evaluations/requeue%20policy%20evaluation?view=azure-devops-rest-5.1