Skip to content

Introduce generic child->parent label inference

Rémy Coutable requested to merge 152-engineering-allocation-hygiene into master

This makes the TypeLabel processor generic by handling trees of labels (e.g. bug (parent) -> security (child), feature (parent) -> [feature::addition, feature::maintenance, feature::enhancement] (children) etc.).

  • Labels tree are represented by a simple LabelTree = Struct.new(:parent_label, :child_labels, :label_group) class.
  • Label = Struct.new(:text, :multiple_parents) represents a single label, with a multiple_parents attribute that tells whether different parent labels can be set on a given label (e.g. security can have ~bug or ~feature). In that case, we never change the parent label that's currently set.
  • LabelTree#label_group allow to define label tree parents that are mutually exclusive. For instance trees for bug and feature both use the same :mr_type label group. This is used to remove irrelevant parent labels.
  • LabelMatch = Struct.new(:label, :label_tree) is used to encapsulate a match between a textual label (from the webhook payload) to its corresponding label tree.
  • LABELS_TAXONOMY is an array of LabelTree objects.
  • The current behavior should be kept exactly the same, but now we also add Engineering Allocation every time an ~"Eng-Consumer::*" or ~"Eng-Producer::*" label is added.

Action items

  • When adding a new Triager, verify that it has been added to the DEFAULT_TRIAGERS in triage/triage/handler.rb in the appropriate order.
  • If applicable, identify the affected groups and how to communicate to them:
    • /cc @person_or_group =>
    • Relevant Slack channels =>
    • Week-in-review

Closes #152 (closed).

Edited by Rémy Coutable

Merge request reports