Skip to content

Fix post merge CI status bug [RUN AS-IF-FOSS]

Payton Burdette requested to merge 225710-fix-post-merge-pipeline-status into master

What does this MR do and why?

This MR fixes a problem with post merge MR's where a pipeline error message is showing even though a pipeline exists.

The bug comes from this block of code in app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue

hasCIError() {
  return this.hasPipeline && !this.ciStatus;
},

A post merge pipeline does not have the pipeline object. It has a mergePipeline object and will never have ciStatus from my testing.

See my proposed solution in the diffs of adding a handler on post merge.

Related to: #225710 (closed)

Screenshots or screen recordings

Post merge before and after. Take note of the pipeline error state before and after.

before after
Screen_Shot_2021-09-20_at_10.57.35_AM Screen_Shot_2021-09-20_at_12.03.31_PM

How to set up and validate locally

  • Setup .gitlab-ci.yml file
image: busybox:latest

build:
  stage: build
  script:
    - echo "Do your build here"
  only:
    - main
  • Create a new MR
  • Merge the MR
  • Ensure pipeline status is shown in MR and not the error message

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #225710 (closed)

Edited by Payton Burdette

Merge request reports

Loading