Atlantis does not take into account GitHub checks in the Expected - Waiting for status to be reported
-state when determining if a pull request is mergeable
#4272
Labels
bug
Something isn't working
Community Note
Overview of the Issue
Atlantis does not take into account GitHub checks in the
Expected - Waiting for status to be reported
-state when determining if a pull request is mergeable. Resolving this issue may however be infeasible given the current state of GitHub's API, see cli/cli#6448. This is really an issue with GitHub's API more than with Atlantis, but I'm putting this issue up anyway for the sake of visibility. It may be possible to list all required checks through the rulesets and branch protection endpoints of the API and check that all of them appear in the status checks rollup of the pull request, but this could get complicated and is essentially reimplementing GitHub's internal logic.Reproduction Steps
Creating a branch protection rule or ruleset that requires a check that does not exist will result in a required check forever stuck in the
Expected - Waiting for status to be reported
-state. The pull request will not be mergeable in this condition. The GitHub GUI will show this, being rendered internally in GitHub, but the GitHub API will not expose it. Consequently Atlantis will not know of the required check and will assume the pull request is mergeable.A similar situation can occur if a new required check is added through branch protection or ruleset after a commit was pushed to the pull request. The creation of the check does not trigger its execution, so the check will be stuck in the
Expected - Waiting for status to be reported
-state. Again, this will be shown in the GitHub GUI, but will not be exposed in the GitHub API, the pull request is not mergeable but Atlantis will not know. But in this case, pushing a new commit on the pull request branch or closing and re-opening the pull request will trigger the check (and it will go into one of the states visible in the API, e.g.PENDING
), after which it will in fact be visible to Atlantis as expected.Logs
Environment details
Additional Context
The text was updated successfully, but these errors were encountered: