MergeRequests API option to mark merge request as merged

Why

A customer wanted to use the API to mark an MR as merged because the change was already merged by and external tool.

What

PUT /projects/:id/merge_requests/:merge_request_id to accept state_event option mark_as_merged.

This could either be passed directly to the model or wrapped in a service to trigger any actions needed from PostMergeService. The model already has the following:

    event :mark_as_merged do
      transition [:reopened, :opened, :locked] => :merged
    end

Links / references

  • https://gitlab.zendesk.com/agent/tickets/52552
  • https://gitlab.com/gitlab-org/gitlab-ce/issues/25566
Assignee Loading
Time tracking Loading