Skip to content

UI instructions are incorrect and misleading when "Add To Merge Train When Pipeline Succeeds" pipeline fails or is cancelled

Summary

When

  1. Merge Trains are enabled, and
  2. an MR is added to the Merge Train, and
  3. 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" : Screen_Shot_2020-12-04_at_2.23.08_PM

However:

  1. There's no need to push a new commit
  2. You are not allowed to retry jobs for merge pipelines (you have to rerun a whole new pipeline - but maybe this might change eventually)
  3. /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

  1. Go to a project (such as www-gitlab-com where Merge Trains are enabled
  2. Make an MR and get a green pipeline.
  3. Click "Add To Merge Train When Pipeline Succeeds"
  4. 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)
  5. 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:

  1. The pipeline would be automatically re-tried, and/or
  2. A button is shown to re-try the merge.

Relevant logs and/or screenshots

This is the misleading message:

Screen_Shot_2020-12-04_at_2.23.08_PM

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

Edited by Veethika Mishra