Skip to content

Update CI bridge status label to use core label as fallback

Leaminn Ma requested to merge 390377-status-tooltip-string into master

What does this MR do and why?

This MR addresses the bug described in #390377 (closed). Basically, an error occurs upon fetching the pipeline's job list after a Trigger job has been retried. The fetch is initiated when you view the Jobs tab in the Pipeline view.

The error happens because @status.status_tooltip is producing a nil value at the time of calling, which raises an undefined method '+' for nil:NilClass exception.

In this context, @status.status_tooltip gets its value from the label method. This MR updates Ci::Status::Bridge::Common.label so that it uses the core status' label value if the bridge description is nil.

How to reproduce the error

  1. Enable ci_recreate_downstream_pipeline
Feature.enable(:ci_recreate_downstream_pipeline)
  1. Update .gitlab-ci.yml with a trigger job config. Sample config file :
trigger_job:
  stage: build
  trigger: 'group-a/project-6'
  1. Run the pipeline.

  2. In the Pipeline View, click the retry button on the trigger job.

  3. After the job is retried, go to the "Jobs" tab, refresh the page and you will see the following:

Screenshot_2023-02-06_at_2.01.15_PM

How to set up and validate locally

  1. Follow steps 1-5 above and observe that the error no longer occurs. The jobs tab populates as expected. (Note that a page refresh is not required when the bug is fixed; the jobs list updates dynamically.)
Sample screenshot Screenshot_2023-02-09_at_6.14.29_PM

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 #390377 (closed)

Edited by Leaminn Ma

Merge request reports