Run check_mergeability only if merge status requires it
What does this MR do?
check_mergeability method is used only to set merge_status
column:
-
MergeRequest#mergeable? is using the value of
merge_status
column to answer, whether the merge request is mergeable - API just serializes the merge_status field
That's why we don't need to run MergeabilityCheckService#execute
if the merge_status
column is not going to be updated and for check_mergeability
method it's updated only if recheck_merge_status?
is true
MergeabilityCheckService#execute
does plenty of work to build a response, so running it conditionally is a quick win for the case, when we don't have to check mergeability of a merge request
Related issues: #33150 (closed)
Edited by Igor Drozdov