Skip to content

Add policy to apply relevant stage label based on legacy label (Merge Requests)

Mark Fletcher requested to merge mr-migrate-single-legacy-labels into master

1st stage of label migrations for MRs:

MRs can exist with:

  • 1 legacy label applied
  • Multiple legacy labels applied

Some of these MRs with a legacy label applied do not yet have a stage label.

Here we will find all merged MRs with one legacy label and no stage label, and apply the stage label relevant to that legacy label. This is to migrate the data eligible to be considered in the throughputs charts.

For example:

MR labelled with only ~Plan legacy label and without devopsplan. We will apply devopsplan here


  1. We will need to compare the MRs existing legacy labels against all other legacy labels to ensure that only one exists:
  • Create
  • Gitaly
  • Gitter
  • Manage
  • Plan
  • Verify
  • Package
  • Release
  • Configure
  • Monitor
  • Secure
  • Defend
  • Growth
  • Distribution
  • Geo
  • Memory
  • Ecosystem
  1. We will need to check that no stage labels already exists. We don't want to override a label already added

Flow

graph TB;
  title[Merge Request Legacy label migration];
  title-->A;
  style title fill:#FFF,stroke:#FFF;
  linkStyle 0 stroke:#FFF,stroke-width:0;

  A{Multiple legacy labels present?} -- Yes --> B;
  B{Stage label is present?} -- Yes --> X1[Nothing to do.];
  B -- No --> E;
  E{Work for next iteration};
  A -- No --> C;
  C{Stage label is present?} -- Yes --> X5[Nothing to do. Don't override existing stage!];
  C -- No --> D;
  D{Group label should be applied as part of mapping?} -- Yes --> G;
  D -- No --> X2[Only add the relevant stage label];
  G{Group label is present} -- Yes --> X6[Nothing to do. Don't override existing group!];
  G -- No --> X7[Add relevant group and stage labels];
Edited by Lin Jen-Shin

Merge request reports