app/services/merge_requests/merge_when_build_succeeds_service.rb
# Marks the passed `merge_request` to be merged when the build succeeds or
# updates the params for the automatic merge
Marks the passed `merge_request` to be merged when the build succeeds or
updates the params for the automatic merge
Marks the passed ` merge_request ` to be merged when the build succeeds or updates the params for the automatic merge
def execute(merge_request)
      merge_request.merge_params.merge!(params)
      already_approved = merge_request.merge_when_build_succeeds?
      unless already_approved
        merge_request.merge_when_build_succeeds = true
        merge_request.merge_user                = @current_user
        SystemNoteService.merge_when_build_succeeds(merge_request, @project, @current_user, merge_request.last_commit)
      end
      merge_request.save
    end
def execute ( merge_request ) merge_request . merge_params . merge! ( params ) already_approved = merge_request . merge_when_build_succeeds? unless already_approved merge_request . merge_when_build_succeeds = true merge_request . merge_user = @current_user SystemNoteService . merge_when_build_succeeds ( merge_request , @project , @current_user , merge_request . last_commit ) end merge_request . save end
Marks the passed `merge_request` to be merged when the build succeeds or
updates the params for the automatic merge
Marks the passed ` merge_request ` to be merged when the build succeeds or updates the params for the automatic merge
# The service is also called when the merge params are updated.
merge_request