Skip to content

Quick action to create MR pipeline and set auto-merge

Problem to solve

Maintainers need a faster way to get merge requests merged when using Pipelines for Merged Results. The current workflow requires multiple manual steps:

  1. Click "Run Pipeline" (if more than 2 hours have elapsed)
  2. Wait for pipeline creation (can take up to 2 minutes)
  3. Click "Set to auto-merge"
  4. Wait for pipeline to pass and MR to merge

With Pipelines for Merged Results, every pipeline runs as if the changes were already merged into the target branch. This means if the target branch is broken, you just need to wait for a fix and rerun the pipeline—no rebasing required. However, this also means pipelines older than 2 hours may not reflect the current state of the target branch, requiring a fresh pipeline run before merging.

Proposal

Add a /ship quick action for merge requests that combines pipeline creation and auto-merge setup into a single command.

What it does:

  • Creates a new CI/CD pipeline for the merge request
  • Enables "Merge when pipeline succeeds" (auto-merge)
  • Automatically merges the MR once all checks pass

Usage:

/ship

This eliminates the need for maintainers to:

  • Wait for pipeline creation (which can take 2+ minutes on big pipeline like gitlab-org/gitlab)
  • Manually enable auto-merge
  • Monitor the MR for merge completion

Documentation

Should be documented in https://docs.gitlab.com/ee/user/project/quick_actions.html

What does success look like, and how can we measure that?

Success metrics:

  • Reduced time from "ready to merge" to "merged"
  • Fewer clicks required for maintainers
  • Usage metrics showing adoption of /ship command
  • Reduced manual monitoring of MR status
Edited by Fabio Pitino