Skip to content

Stable branch Danger package-and-test rules

Steve Abrams requested to merge delivery2797-package-and-test-danger into master

🏘 What does this MR do and why?

groupdelivery is working to extend the maintenance policy and allow engineers to merge bug fix backports directly into stable branches.

This MR updates the Danger tooling with a few new rules around stable branches. Because stable branches need to remain...stable, we want to be sure the package-and-test pipeline is always run before merging. It is not uncommon for that pipeline to fail, so we need to inform engineers what to do in those cases.

The Danger updates include:

  • Add a section to the Danger output explaining what to do if the e2e:package-and-test pipeline fails.
  • Have Danger fail if the pipeline:expedite label is present on the MR (that label causes the package-and-test pipeline to be skipped).
  • Have Danger fail if for some reason the package-and-test pipeline has not started running.

The last two points are skipped if:

  1. The MR includes the failureflaky-test label
  2. The MR includes only documentation changes

For some additional context, the package-and-test pipeline does run automatically on all MR pipelines for MRs targeting stable branches, so the last error will only show up if something happens to cause the pipeline not to run, for example, adding the pipeline:expedite label.

📸 Screenshots or screen recordings

This MR ran these Danger changes while targeting a stable branch. You can see the resulting failures here: !111491 (comment 1271177755)

New failure errors:

Screenshot_2023-02-06_at_1.25.06_PM

New section describing the package-and-test failure process:

Screenshot_2023-02-08_at_12.59.27_PM

💻 How to set up and validate locally

  1. Checkout a stable branch (for example 15-7-stable-ee)
  2. Create a new branch from the stable branch
  3. Cherry-pick the commit from this MR, or apply the git diff on your new branch
  4. Push the branch and open an MR targeting the stable branch.
  5. Name the MR with "Revert" at the beginning of the MR title and add the pipeline:expedite label
  6. Danger should fail and have error messages referencing both the pipeline:expedite label as well as the missing package-and-test pipeline. There should also be a new section at the bottom of Danger explaining what to do when the package-and-test job fails.

I opened an MR like this, see the Danger failure here: !110968 (comment 1267465471)

🛃 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 gitlab-com/gl-infra/delivery#2797 (closed)

Edited by Steve Abrams

Merge request reports