Skip to content

Fixes "retryable" value for merge train pipelines as JSON

What does this MR do and why?

Implements #436348 (closed), part of #442453 (closed)

This change updates the value of "retryable" in merge train pipelines when the pipeline is fetched with JSON format.

This allows the "retryable" to stay consistent across the GraphQL API and other models.

Changelog: fixed

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
Screenshot_2024-05-13_at_16.55.41 image

How to set up and validate locally

  1. You'll need a .gitlab-ci.yml compatible with merge trains, that also happens to pass during a regular pipeline and fail during a merge train.

I used the following:

workflow:
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'

stages:
  - build

normal-job:
  stage: build
  environment: production
  script:
    - echo "Running..."
    - sleep 20
    - echo "Done."

fail-on-merge-train:
  stage: build
  rules:
    - if: $CI_MERGE_REQUEST_EVENT_TYPE == 'merge_train'
  script:
    - echo $CI_MERGE_REQUEST_EVENT_TYPE
    - echo "Failing because this is a merge train, sorry!"
    - exit 1
  1. Enable merge trains by selecting "Enable merge trains" at Project -> Settings -> Merge requests (e.g. http://gdk.test:3000/my-group/my-merge-trains/-/settings/merge_requests)
  2. Open an MR with an arbitrary change
  3. Hit Merge and wait for the merge train pipeline to fail
  4. Visit the Pipelines tab and confirm there is no retry button (e.g. http://gdk.test:3000/my-group/my-merge-trains/-/merge_requests/5/pipelines)
Edited by Miguel Rincon

Merge request reports