UI instructions are incorrect and misleading when "Add To Merge Train When Pipeline Succeeds" pipeline fails or is cancelled
Summary
When
- Merge Trains are enabled, and
- an MR is added to the Merge Train, and
- The triggered merge pipeline fails, due to an infrastructure failure or being cancelled...
...the UI instructions are incorrect and misleading.
The UI which is displayed says "The pipeline for this merge request failed. Please retry the job or push a new commit to fix the failure" :
However:
- There's no need to push a new commit
- You are not allowed to retry jobs for merge pipelines (you have to rerun a whole new pipeline - but maybe this might change eventually)
-
/merge
appears to fix the issue in this case, but there's a risk of showing the suggestion for merge request pipelines
Proposal
Reframe the message in the MR widget to urge users to take action in accordance with the pipeline type(merge request, merge result and merge train) and link them to the relevant part of documentation.
Old Proposal
The correct required actions are documented here:Unable to add to merge train with message "The pipeline for this merge request failed."
Sometimes the Start/Add to Merge Train button is not available and the merge request says, "The pipeline for this merge request failed. Please retry the job or push a new commit to fix the failure."
This issue occurs when Pipelines must succeed is enabled in Settings > General > Merge requests. This option requires that you run a new successful pipeline before you can re-add a merge request to a merge train.
Merge trains ensure that each pipeline has succeeded before a merge happens, so you can clear the Pipelines must succeed check box and keep Enable merge trains and pipelines for merged results (merge trains) enabled.
If you want to keep the Pipelines must succeed option enabled along with Merge Trains, you can create a new pipeline for merged results when this error occurs by going to the Pipelines tab and clicking Run pipeline. Then click Start/Add to merge train when pipeline succeeds.
Steps to reproduce
- Go to a project (such as
www-gitlab-com
where Merge Trains are enabled - Make an MR and get a green pipeline.
- Click "Add To Merge Train When Pipeline Succeeds"
- Go to the Pipelines tab and cancel the pipeline, or click "Cancel automatic merge" (note this is the same as if the pipeline fails due to a flake or infrastructure problem)
- Go back to the Overview tab and see the incorrect message "The pipeline for this merge request failed. Please retry the job or push a new commit to fix the failure".
What is the current bug behavior?
You see the incorrect message "The pipeline for this merge request failed. Please retry the job or push a new commit to fix the failure".
What is the expected correct behavior?
At a minimum, the instructions should match what the documentation says to do (manually run a new pipeline than manually click the button again).
Ideally, there would not be any need to manually re-run a new pipeline, because it's unnecessary (nothing has changed since the last green build before attempting the merge), and instead:
- The pipeline would be automatically re-tried, and/or
- A button is shown to re-try the merge.
Relevant logs and/or screenshots
This is the misleading message:
Instances of this causing confusion
There have been many in the past, but here are some that have happened since 2020-12-07
Related Issues and Epics
- #35135 (closed) (issue to improve behavior of merge button)
- #12267
- &4911 (closed)