Skip to content

Run check_mergeability only if merge status requires it

Igor Drozdov requested to merge id-conditional-check-mergeability into master

What does this MR do?

check_mergeability method is used only to set merge_status column:

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

Merge request reports