Skip to content

Get "Merge when build succeeds" to work when commits were pushed to MR target branch while builds were running

Douwe Maan requested to merge merge-when-build-succeeds-unchecked into master

The Merge when build succeeds service only merges when the MR is mergeable (open, not WIP, no conflicts).

When the target branch is updated, all affected MRs have their merge status set to unchecked, and the conflicts check will only happen when check_if_can_be_merged is called, which happens when the MR page is viewed.

When someone enables the automatic merge, the target branch is updated, no-one views the MR page again, and the build succeeds, the mergeability check will fail and the MR will not in fact be merged.

This MR makes sure check_if_can_be_merged is always called when MR mergeability is checked.

@rspeicher Patch release material methinks!

cc @zj

Merge request reports