• Robert Speicher's avatar
    Merge branch 'merge-when-build-succeeds-unchecked' into 'master' · f076e4eb
    Robert Speicher authored
    Get "Merge when build succeeds" to work when commits were pushed to MR
    target branch while builds were running
    
    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.
    
    See merge request !2304
    f076e4eb
merge_requests_controller.rb 9.68 KB