Skip to content

Autolabel group label on MRs based on author group information from team.yml

We need to start enforcing a high-level data hygiene on throughputs.

let's use this issue to implement the team member mapping to group labels. Also let's stop using the word "team" we need to be clear on the terminology.

Let's reuse the mechanism from enforcing stage labels.

Proposal

  • Singularity on Stages and Groups will be built-in with scoped labels.
  • Improving the hygiene accounting on group::xxx labels
    • For un-labeled MRs we should be able to infer from a team member mapping in team.yml at that point in time to the group::xxx. This would also solve the case when engineers move from group to group since the label preserves that mapping at that point in time.
    • We will not auto label things that are corrected by a human or if the label is already present.
    • If data is not present in team.yml we should introduce a structure there
  • Improving the hygiene accounting to devops:xxx labels
    • If there is category label, map to the stage of category label.
    • If there is only group label, we will not auto label, as the group label could belong to an MR author who is working outside of their stage
    • We will not auto label things that are corrected by a human or if the label is already present.
  • Stretch: Auto add specialty label and either frontend / backend

Solution

First we attempt to add group label based on the MR author in pre-hygiene stage. This would set the stage for stage-and-group-labels-hygiene whereby most MRs would have group label set either manually or inferred from the MR author.

The next stage-and-group-labels-hygiene job will then attempt to infer the remaining labels based on this table:

# has_stage_label? has_group_label? has_category_labels? group_is_part_of_stage? inference_strategy
1 true true true N.A Not needed
2 true true false true infer category from group
3 true true false false do not infer category - too many categories per stage to infer reliably
4 true false true N.A infer group from category or stage
5 false true true N.A infer stage from category
6 false true false N.A do not infer stage and category
7 false false false N.A Not possible to infer

Work to do

  • Create a new entry point for MR label inference based on above
  • Create new job in pre-hygiene to add group label based on MR author
  • Use new entry point in MR label inference
Edited by Albert Salim