-
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
fix: Include required checks while evaluating the mergeable state if apply is bypassed #3916
Conversation
@lukemassa do you happen to have any input on this? |
I am much less familiar with github's terminology/expectations around checks, but this logic seems reasonable to me. Right now it seems like we're only considered required vs not for check suites, whereas this change makes it so we look at required vs not for combined check status as well. |
Hi @jamengual, Anything needed from my end to take this forward? I am kinda new here as a contributor :) so not sure how exactly it works. |
Hi @bhavith. We need to review the code when we find some time. We will get back to you as soon as we can. Thanks for the contribution. |
perfect! 👍 |
We have run into this a quite a few times and weren't sure what was going on. Here's the scenario:
This seems to happen intermittently rather than consistently, but it's possible it's only working when either a) the branch build never starts because a PR is opened immediately, or b) the branch build has finished successfully before the PR build begins. |
It will probably make sense to combine this PR with this change #3812 to make the whole feature even more reliable. |
Looks like the PR author of #3812 doesn't have time to work on his PR, please feel free to merge both in this PR. |
Will have a look at #3812 and get back. |
I will make some changes in this PR based on #3812 (comment). That will be in 2024. Happy holidays. 🎄 |
This issue is stale because it has been open for 1 month with no activity. Remove stale label or comment or this will be closed in 1 month. |
@bhavith any update? |
Came back from vacation sick and weather in Norway wasn't very helpful either. I will try to work on it sometime this week/weekend. |
This issue is stale because it has been open for 1 month with no activity. Remove stale label or comment or this will be closed in 1 month. |
what
Currently when the apply condition is set to mergeable along with
--gh-allow-mergeable-bypass-apply
flag, Atlantis considers non required status checks as well to decide whether the PR is mergeable or not (to allow apply or not). This is a deviation from standard github mergeable status.This PR changes that and includes only required status checks while evaluating mergeable status.
why
Atlantis uses mergeable status from github API to check if a PR is mergeable if
--gh-allow-mergeable-bypass-apply
is not set. That is if the status isunstable
, the PR is considered mergeable.If
--gh-allow-mergeable-bypass-apply
enabled, github uses some additional checks to see if the PR is mergeable without consideringatlantis apply
. But in these additional checks, Atlantis looks at all statuses irrespective of if they are required or not. So, if there is a status check that is failing Atlantis will consider it non mergeable even if its not a required status check and thus will block Apply.In this change, while checking if the state is
success
, it will also check if the particular status is one of the required checks. Hence Atlantis will report non mergeable only if the failing status check is a required one.tests