Skip to content

Merge trains GET API

What does this MR do and why?

Creates a GET API endpoint for merge trains. This returns all of the merge train cars aimed at the target branch. Merge trains are a premium feature so this is intended to also be a premium feature.

GET /projects/:id/merge_trains/:target_branch

This MR models the API structure as as described in: !100853 (comment 1145074169)

This MR is related to the Epic: &5864 (#381068 (closed) created for this MR)

It takes into account the future changes from: #298541 (closed)

Related MRs for this API Bundle

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

  1. Run gitlab in premium mode
  2. Request the API with GET /projects/:id/merge_trains/:target_branch

To get more interesting responses from the API:

  1. Create a project
  2. Add merge requests to the project
  3. Add the merge requests to the merge train
  4. Request the API with GET /pojects/:id/merge_trains/:target_branch

Example Usage:

curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/merge_trains/:target_branch"

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Fabio Pitino

Merge request reports