Fixes "retryable" value for merge train pipelines as JSON
requested to merge 436348-remove-retry-all-failed-jobs-button-from-merge-train-pipelines into master
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 |
---|---|
How to set up and validate locally
- 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
- 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)
- Open an MR with an arbitrary change
- Hit Merge and wait for the merge train pipeline to fail
- 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