Improve messaging for when a merge request is dropped from a merge train

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

When a merge request is dropped from a merge train a message explaining why is presented to the user on the merge request. However, this message is a bit vague. Additional details about the nature of the problem can help users troubleshoot.

We could add two small improvements:

  • Ensure messages at ee/app/services/system_notes/merge_train_service.rb get localized: they are hardcoded right now.
  • Have a pass in the copy text to format the messages like because #{reason} be formatted correctly, so they don't get rendered as "...because The reason for ... " or "...because The pipeline failed..."

Problem to solve

A customer reported (internal link only) that a merge request was dropped from a merge train and they weren't sure why. The merge request had the following comment added to explain why the merge request was dropped:

<USERNAME> removed this merge request from the merge train because 9:Failed to create merge commit for source_sha c8fc16dd and target_sha ad144da9 at refs/merge-requests/XXXX/train.

Proposal

I propose we add some more details about the failure to assist users with troubleshooting, so they can re-add the merge request to a merge train successfully.

Edited by Miguel Rincon