Merged merge request shows latest pipeline for target branch rather than the merge pipeline

Summary

When looking at an old merge request that has been accepted, i.e. merged to the target branch, I see the latest pipeline for the target branch rather than the pipeline for the relevant merge.

E.g. here we see a merge that is clearly shown as having happened a month ago. But the pipeline and SHA shown, i.e. #21083 (closed) and ccd197f8, are actually for the latest merge to master.

image

So when I jump to this pipeline, I see that it occurred yesterday rather than a month ago (and is clearly for a different ticket):

image

I have to search down through the pipeline history for the actual pipeline that should be associated with the merge request:

image

Steps to reproduce

See above, i.e.:

  1. Submit an MR and accept it so that it's merged to master - note the pipeline associated with the merge to master.
  2. Submit another MR and accept it also.
  3. Go back to the original MR - the pipeline shown for the merge to master is now that of the subsequent merge.

Example Project

We're using "GitLab Community Edition 12.0.3", i.e. a version released back in July. We're not currently in a position to upgrade this so I cannot confirm if this issue has since been fixed.

It seems unlikely that others would have reported such a serious issue in the meantime but I could not find a similar existing issue.

What is the current bug behavior?

The pipeline for an old merge request is not the pipeline that merged the change to the target branch at that time, but is instead the latest pipeline for the target branch.

What is the expected correct behavior?

The pipeline for an old merge request should be the pipeline that merged the change to the target branch at that time.

Relevant logs and/or screenshots

See screenshots in summary.

Output of checks

...

Results of GitLab environment info

...

Results of GitLab application Check

...

Possible fixes

...

Assignee Loading
Time tracking Loading