-
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: Fix GitHub pull request mergeability for multiple required workflow runs #5057
fix: Fix GitHub pull request mergeability for multiple required workflow runs #5057
Conversation
Signed-off-by: Roman Ryzhyi <[email protected]>
Signed-off-by: Roman Ryzhyi <[email protected]>
Signed-off-by: Roman Ryzhyi <[email protected]>
Signed-off-by: Roman Ryzhyi <[email protected]>
Signed-off-by: Roman Ryzhyi <[email protected]>
Hi @ajax-ryzhyi-r, you have some spurious file changes in this PR that aren't relevant to your change. Can you revert them please? (Adding EOF LFs t files you haven't changed.) |
Signed-off-by: Roman Ryzhyi <[email protected]>
Signed-off-by: Roman Ryzhyi <[email protected]>
Signed-off-by: Roman Ryzhyi <[email protected]>
cc @ajax-ryzhyi-r if you can address the above comments, this pr has a higher chance of getting into the next release which should be fairly soon |
@nitrocode I've already addressed all the comments above. If there's anything else I need to fix, please let me know |
If you could click "Resolved" for the issues that you've addressed just to confirm there's nothing left. It looks like there might still be some end-of-line issues, for example https://github.com/runatlantis/atlantis/pull/5057/files#diff-adec0aa1d9d8bb750060e06ba970ea7ae5817c8517d94a862da133a95e1d2466R95, if you could take a look? Otherwise the logic makes sense to me, I'm going to see if I can replicate the issue and confirm the new code fix |
I cannot hide comments with "Resolved" status which I don't own ;) EOF related changes in the files I've edited appear to be legitimate due to the .editorconfig settings in this repository -https://github.com/runatlantis/atlantis/blob/main/.editorconfig#L7 |
Signed-off-by: Roman Ryzhyi <[email protected]>
@henriklundstrom, can you resolve the conversations that you started if you happy with the responses, and then we can get this PR merged. |
@X-Guardian I actually can not! But I can say here that I'm happy with all of them, and let's proceed. |
Thanks for your work on this @ajax-ryzhyi-r & @henriklundstrom . Can you test it using one of the following dev images: dev-debian-b975301 or dev-alpine-b975301 |
…low runs (runatlantis#5057) Signed-off-by: Roman Ryzhyi <[email protected]>
…low runs (runatlantis#5057) Signed-off-by: Roman Ryzhyi <[email protected]> Signed-off-by: kvanzuijlen <[email protected]>
what
This PR modifies the mergeability evaluation logic for GitHub pull requests by evaluating the latest workflow check run (by comparing
runNumber
's) instead of the first one returned from the GitHub API.why
There is an issue described in detail in #5048 where Atlantis treats a PR as unmergeable when there are multiple required GiHub Actions workflow runs for the last commit of the branch and the first of them is failed atlantis responds with the error
Apply Failed: Pull request must be mergeable before running apply.
when attempting to use theatlantis apply
command.Upon investigating this issue, I discovered that GitHub returns all
checkRuns
in chronological order when Atlantis retrieves a pull request's last commit mergeability status. However, Atlantis iterates through thesecheckRuns
and retrieves the firstcheckRun
instead of the last one, which represents the current status.tests
references
Fixes the issue discussed in comments of #5048