Could not retrieve the pipeline status. For troubleshooting steps, read the documentation (GitLab CI)
Summary
This bug happens on the GitLab.com interface. We’re using Gitlab with Gitlab CI on a shared, free plan, with public workers. Our mode of operation is to encourage developers to work in Git branches and keep 1 merge request opened per branch, with it transitioning between MR open/close state during review iterations. We notice that after reopening a merge request, the Gitlab pipeline will run but the status is not reflected in the merge request view (main screen).
Steps to reproduce
Outlined in comment #225710 (comment 675913518)
What is the current bug behavior?
GitLab does not show an accurate pipeline status to merge request page. We noticed that in a flow of:
- Developer opened an MR “X”
- Reviewer reviewed it, suggested changes, closed MR “X”
- Developer pushes commits to address change requests
- Developer waits to see a CI job to finish successfully (GitLab -> CI -> Pipelines tab and also GitLab -> Ci -> Jobs tab appear to show the right status for the most recently pushed commits)
- Developer reopened MR “X”
- Gitlab very often ends with this error message: “Could not retrieve the pipeline status. For troubleshooting steps, read the documentation”.
- When we go to “Pipelines” for this MR, the pipeline status is correctly reflected. We noticed that this issue persists for very many hours.
We noticed that the possible workaround is to push a commit when an MR is opened. For example, some MRs left opened, but later pre-merged with “master”, get out of this state.
Leaving the merge request open overnight (and then pushing a few more commits to the branch) also solved the problem.
What is the expected correct behavior?
Should link the pipeline status (success/fail) to merge request page immediately, instead of needing to wait an excessive amount of time or having to push additional commits.
Relevant logs and/or screenshots
Could not retrieve the pipeline status. For troubleshooting steps, read the documentation.
The documentation link points to here.
Proposal
A isPostMerge
MR is checking for mr.ciStatus
which is undefined
always and we return an error message to the user. We should add a handler for the CI status and return the status of a merge pipeline instead.
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline_container.vue
hasCIStatus() {
return this.isPostMerge ? !isEmpty(this.mr.mergePipeline.details.status) : this.mr.ciStatus;
},
Also may need to make app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue
prop ciStatus
accept both String
and Boolean
types.