Resolve "Bug: When using the /merge quick action, it returns 'Merged' even though it was not"
What does this MR do and why?
The current issue is that the merge orchestration code checks the mergeability_state, and not the mergeable_state. This means that these things are not being checked (https://gitlab.com/gitlab-org/gitlab/-/blob/08e1047a5ec8c90013cf2114f7d5b59e95fa9142/ee/app/models/ee/merge_request.rb#L122). If approvers, has_denied_policies or mr is blocked.
However, when we go to merge it later async, we check mergeable?
. So the merge orchestration check can return true that it is mergeable, even though it is not.
We can either, a) change the mergeable_state to be mergeable, or move these three checks to mergeable_state.
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #354453 (closed)