Skip to content

"Could not retrieve the pipeline status" appears for merged MRs that only have a pipeline for merge requests

Summary

Could not retrieve the pipeline status appears for merged MRs that only have a pipeline configured to run for a source branch i.e. a pipeline is ran only after merging.

Steps to reproduce

  • create a project a configure the pipelines to run only on master i.e.
test_job:
  script: echo
  only: [master]
  • create a new branch, create an MR based on this branch and merge this MR
  • you will get an error Could not retrieve the pipeline status shown in UI

Example Project

atanayno/mr-pipeline-test!1 (merged)

What is the current bug behavior?

The error Could not retrieve the pipeline status. For troubleshooting steps, read the documentation. is shown in the MR pipeline widget.

What is the expected correct behavior?

The link to the pipeline should be shown instead of the error.

Relevant logs and/or screenshots

Screen_Shot_2020-09-15_at_3.53.22_PM

Output of checks

This bug happens on GitLab.com

Possible fixes

It happens because has_ci? method returns false for such merge requests, see https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/models/merge_request.rb#L1202.

Affecting:

Edited by Sokunrotanak Srey (Rotanak)