Skip to content

Skip Danger failure when package-and-test is being created

What does this MR do and why?

The package-and-test execution is required for merge requests targeting stable branches. Danger should fail when the package-and-test status is canceled or manual, or when the pipeline is not present. Previous to this commit there was a bug in the logic: Danger failed when the package-and-test pipeline was being created, because it only considered the downstream pipeline status and ignored the bridge status

This commit ensures both statuses, from the bridge and the downstream pipeline, are considered, avoiding the Danger failure when the package-and-test is being created.

Related to gitlab-com/gl-infra/delivery#2839 (closed)

Screenshots or screen recordings

Before After (Tested on https://gitlab.com/gitlab-org/gitlab/-/jobs/3872987847)
Screenshot_2023-03-03_at_12.47.51 Screenshot_2023-03-03_at_12.57.24

package-and-test pipeline manual check

There are three different Danger behaviors regarding the package-and-test execution:

  • Message: If the MR contains application changes, Danger includes a message guiding the execution of the package-and-test pipeline (this is regardless of the package-and-test status)
  • Warning: Danger warns engineers that the package-and-test pipeline should succeed or failures should be reviewed by a SET. This only happens if the package-and-test pipeline did not succeed
  • Failure: Danger fails if the package-and-test is either canceled or manual

Examples:

Message Warning Failure
Screenshot_2023-03-03_at_12.56.36 Screenshot_2023-03-03_at_12.56.48 Screenshot_2023-03-03_at_13.33.21

Summarizing by status:

Status Danger fails? Danger job Danger error Danger warning? Danger section?
Bridge created - No downstream pipeline No Example No Yes Yes
running No Example No Yes Yes
success 1 No No No Yes
failed No Example No Yes Yes
canceled Yes Example Yes No Yes

MR acceptance checklist

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


  1. I was not able to test the success status because the package-and-test pipeline is currently failing.

Edited by Mayra Cabrera

Merge request reports

Loading