fix: Include only required checks while evaluating the mergeable state when apply is ignored#1
Open
bhavith wants to merge 1 commit intofinnag:cogfrom
Open
fix: Include only required checks while evaluating the mergeable state when apply is ignored#1bhavith wants to merge 1 commit intofinnag:cogfrom
bhavith wants to merge 1 commit intofinnag:cogfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what
Currently when the apply condition is set to mergeable along with
--gh-allow-mergeable-bypass-applyflag, 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-applyis not set. That is if the status isunstable, the PR is considered mergeable.If
--gh-allow-mergeable-bypass-applyenabled, 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