API Support to add an MR to the Merge Train
Merge Trains give you the ability to add a Merge Request to a Merge Train and trust that you do not have to worry about a broken build on /main. Adding an MR to the train has had to be a manual action for developers which works if you primarily operate in in the GitLab UI but does not support CI/CD Automation or other flows that some organizations prefer.
Now you can utilize the GitLab API to add a Merge Request to a Merge Train.
Problem to solve
Our merge request API hasn't been updated to support our merge trains feature and public API support is lacking in Merge Train. This means, users cannot automate their workflow via API. Today, users can control via UI, which is manual operation.
Mirror the changes we made to our internal API in order to support merge trains: gitlab-foss!28595 (merged). Instead of sending a request to the
/merge endpoint with
merge_when_pipeline_succeeds: true, the endpoint would instead accept a
auto_merge_strategy parameter with any of the following values:
Permissions and Security
There are no special considerations from a permissions/security standpoint.
The section of our documentation that would be most affected by this change would be the Accept MR API.
The Get single MR endpoint may also need to be updated, depending on our implementation.
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.