• Rémy Coutable's avatar
    Fix a wrong MR status when merge_when_build_succeeds &... · e3d464d8
    Rémy Coutable authored
    Fix a wrong MR status when merge_when_build_succeeds & project.only_allow_merge_if_build_succeeds are true
    
    The issue was that `MergeRequest#mergeable?` returns false when the CI
    state is not success and project.only_allow_merge_if_build_succeeds is
    true. In this case `Projects::MergeRequestsController#merge` would
    return the `:failed` status when enabling `merge_when_build_succeeds`,
    thus leading to a weird state and the MR never automatically merged.
    
    The fix is to disable the CI state check in the controller safeguard
    that early return the `:failed` status.
    Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
    e3d464d8
merge_requests_controller.rb 12.1 KB