Lesstep
GitLab · merge requests · auto-merge · Checked October 24, 2026

GitLab: why auto-merge was refused, merged at once, or canceled

Auto-merge asks GitLab to merge a merge request once its merge checks pass. Through the merge API it is auto_merge: true, from GitLab 17.11; before that it was merge_when_pipeline_succeeds: true, which 17.11 deprecated. Since GitLab 17.7 it waits for all the merge checks, not only the pipeline (GitLab's auto-merge docs). GitLab can still answer 405, merge it on the spot, or cancel it later. All of the following was checked on October 24, 2026 in GitLab's source (lib/api/merge_requests.rb, app/services/auto_merge/merge_when_checks_pass_service.rb, app/models/merge_request.rb) and its merge API docs.

What GitLab does with auto_merge

When auto-merge is set, the answer is 200 with "state":"opened" and "merge_when_pipeline_succeeds":true. On a project with merge trains, the request adds the merge request to the train instead, since GitLab 19.1.

The two 405s that surprise

When GitLab cancels auto-merge

From GitLab's docs, it cancels auto-merge when new commits are pushed to the source branch, so that they get a review. It also cancels it when commits are added to the target branch and the merge method is fast-forward or semi-linear without automatic rebase before merge. Keeping it set when that rebase is on came in GitLab 19.3, behind a feature flag that is off by default. The merge request's activity shows a note when GitLab cancels or aborts auto-merge.

Cancelling it

What to do

GitLab merge requests in IntelliJ IDEA

Merge Request Inbox for GitLab, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, shows a merge request's merge checks before you merge and merges the head commit you had on screen. While the pipeline runs, its Merge dialog offers auto-merge, and sends both auto_merge and merge_when_pipeline_succeeds, so GitLab versions before and after 17.11 understand it. When GitLab merges at once instead, it says the merge request was merged. From version 1.0.15, when GitLab refuses auto-merge (405), it says that auto-merge does not wait for a rebase the merge method needs, and to merge without auto-merge when the pipeline has already ended without succeeding; when GitLab answers but sets nothing, it says so. Before, it gave the message for an ordinary merge, which names a draft, threads, approvals and the pipeline, all of which auto-merge waits for. Reading is free; approving, commenting and merging are Pro (US$1.50 a month, with a 30-day trial).

GITLAB is a trademark of GitLab Inc.; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by GitLab Inc. or JetBrains.

More: GitLab merge refused (400, 401, 405, 409, 422) · GitLab rebase refused or failed (403, 409) · GitLab approval refused (401, 409) · GitLab "insufficient_scope" · GitLab 401 "invalid_token" · GitLab merge request list refused (400, 404) · GitLab merge request changes cut short ("1000+", too_large) · GitLab 429 "Retry later" (rate limits) · GitLab merge refused or failed over squashing · GitLab "compare_timeout": true (diff limits) · GitLab merge request plugins for IntelliJ IDEA, compared · 日本語