Skip to content

Show a merge request link in pipeline failure emails

Shinya Maeda requested to merge show-correct-link-in-mr-pipelines into master

What does this MR do?

Currently, if the pipeline is Pipeline for merge requests (or pipelines for merged results/merge train) and it failed, something like the following email is sent to a commit author:

Screenshot_from_2019-09-23_19-41-16

As the problem is described in #32325 (closed), showing merge request refs (e.g. refs/merge-requests/:iid/merge or head) at the Branch row to users is very confusing, as it's used internally by the system only, and it's not what user actually created/consumed. This effectively reduce their productivity that they have to find the associated merge request manually. (In the above example, an MR link !6 is shown, but currently it's shown when the pipeline is the latest one in the merge request, which is also confusing that there is a case when failure email doesn't have MR link at all even if the pipeline is Pipeline For Merge Request)

This MR solves this problem by two minor fixes

  1. Show pipsline's source branch name always. No more the system ref such as refs/merge-requests/:iid/merge. This is actually same behavior with branch pipelines.
  2. Show MR links always when there is a related merge request. So Pipelines for merge requests/merged results/merge train always show the related one.

screenshot_26

Close #32325 (closed)

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Performance and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Shinya Maeda

Merge request reports