Skip to content

Auto-merge support for Gitlab #847

@Xotabu4

Description

@Xotabu4

Is your feature request related to a problem? Please describe.

The merge action in gitStream currently supports waiting for all checks only on GitHub. The documentation shows that wait_for_all_checks is an optional flag that, when set to true, tells gitStream to merge a pull request only after all checks complete successfully . On GitLab projects, however, this flag has no effect, so the merge action either merges immediately or not at all. This means that in a GitLab workflow we have to choose between merging immediately (which risks merging failing code) or manually setting the merge request to “auto‑merge when pipeline succeeds” through the UI. Having to watch pipelines and manually set auto‑merge defeats the purpose of gitStream’s automation. In our GitLab‑based CI/CD pipelines, we want merge requests to be merged automatically only after the CI pipeline and all required checks finish successfully, just as the wait_for_all_checks flag does for GitHub.

Describe the solution you’d like

Please add support for GitLab’s auto‑merge capabilities to the merge action in gitStream. The GitLab REST API provides an auto_merge boolean flag when merging a merge request (PUT /projects/:id/merge_requests/:merge_request_iid/merge) . When this flag is set, GitLab keeps the merge request open and automatically merges it after the pipeline and all required checks pass. This behavior is also described in GitLab’s user documentation: setting a merge request to auto‑merge causes GitLab to wait until all required checks—CI pipeline, approvals, and other merge checks—have completed before merging . By allowing wait_for_all_checks: true on GitLab projects to map to auto_merge: true in the GitLab API, gitStream could offer the same automatic merge‑when‑ready experience that is currently available only on GitHub. Exposing GitLab‑specific options—such as delete_source_branch, squash, or a way to choose between auto_merge and immediate merge—would further align gitStream with GitLab’s merge API.

Describe alternatives you’ve considered
• Manual auto‑merge in GitLab UI. Today we can manually set a merge request to “Auto‑merge when pipeline succeeds,” but this requires the author or a maintainer to interact with the UI for every merge request, which slows down our continuous merge process and can be forgotten.
• Custom scripts to call the GitLab API. We could write our own scripts to call the GitLab API after pipelines succeed, using the auto_merge or (for older versions) merge_when_pipeline_succeeds field. However, this duplicates functionality that gitStream already provides for GitHub and leads to fragmented automation.
• Using gitStream’s current merge action without waiting. Another option is to let gitStream merge immediately and rely on protected branches to prevent failed pipelines from merging. This defeats the purpose of automated merging because it forces engineers to intervene when pipelines fail.

None of these alternatives provide the seamless, provider‑agnostic continuous merge experience that gitStream offers on GitHub. Supporting GitLab’s auto‑merge via wait_for_all_checks would eliminate the need for manual workarounds and keep all merge logic within gitStream.

Additional context
• The merge action documentation describes wait_for_all_checks as waiting for all checks (statuses) before merging, but it does not yet work for GitLab .
• GitLab’s merge‑request API accepts an auto_merge flag (replacing the deprecated merge_when_pipeline_succeeds) which merges the merge request only after the pipeline succeeds .
• The GitLab user documentation clarifies that when a merge request is set to auto‑merge, GitLab enforces all merge checks and then merges automatically .
• Many GitLab users, particularly those managing CI/CD pipelines and automated merges, would benefit from consistent behavior across providers—waiting for all checks on both GitHub and GitLab—and would prefer to configure this via gitStream’s YAML rather than maintain separate scripts or manual steps.

Thank you for considering this feature request. Adding GitLab auto‑merge support will help teams using gitStream with GitLab achieve the same level of hands‑off automation currently available on GitHub, improving developer productivity and reducing manual overhead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions