Skip to content

Backend: Status on multi-project pipelines incorrect with cancellations or retries

Summary

When a multi-project pipeline is retried or cancelled, the status on the upstream pipelines stays "failed" instead of reflecting the current status. We noticed several cases where the status changes are not propagated:

Example screenshot where the pipeline was cancelled but the status is failed instead of cancelled:

Screenshot_2020-06-08_Pipeline___Veronika_Kabatova_kernel-cosScreenshot_2020-06-08_Add_CI___1____Merge_Requests___gitlabPorcelainSandbox_kernel-cos

Querying the pipeline API also incorrectly shows the pipeline as failed.

Steps to reproduce

  • Create a multi-project pipeline with a trigger job. Case from the screenshots above (without variables):
workflow:
  rules:
    - if: '$CI_PIPELINE_SOURCE =~ /^(merge_request_event|web|api|trigger)$/'

trigger_pipeline:
  trigger:
    project: cki-project/experimental/playground-veruu
    branch: master
    strategy: depend
  • Downstream pipeline can be anything where cancellations/retries/failures can be triggered.
  • Cancel the downstream pipeline. Observe the upstream status switch to "failed". Retry the cancelled job, the status stays "failed". Leave the retried pipeline to succeed. The upstream status still stays "failed".

Example Project

Upstream project: https://gitlab.com/veruu/kernel-cos/-/tree/add-ci

Downstream project: https://gitlab.com/cki-project/experimental/playground-veruu/

Direct link to an example pipeline with cancel-retry-success flow: https://gitlab.com/veruu/kernel-cos/-/pipelines/153962913

Note that the example CI is complicated due to our specific use case; using the basic trigger outlined in "steps to reproduce" with a dummy downstream pipeline would likely be easier.

What is the current bug behavior?

Status from downstream pipeline is not reflected after the pipeline initially "finishes", e.g. with retries or cancellations - the upstream status is always marked as failed without reflecting the actual pipeline status.

What is the expected correct behavior?

The upstream status of the trigger job / full pipeline correctly reflects downstream status instead of always saying "fail". Specific cases mentioned in "summary".

Relevant logs and/or screenshots

See "summary" and "steps to reproduce".

Output of checks

This bug happens on GitLab.com

Results of GitLab application Check

This bug happens on GitLab.com

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)

Edited by Dov Hershkovitch