Skip to content

Fix empty labels being set in ApplyLabelsFromRelatedIssue

What does this MR do and why?

This MR prevents that empty labels (i.e. ~"") are added to the /label command in the ApplyLabelsFromRelatedIssue processor.

There are three possibilities in the processor right now, 1 and 2 are problematic:

  1. A command like /label ~"" ~"type::maintenance" is a noop (not applying typemaintenance!),
  2. A command like /label ~"" results in an error, and
  3. A command like /label ~"type::maintenance" ~"" correctly applies typemaintenance.

Expected impact & dry-runs

If an issue is related to an MR and the issue didn’t have a type label but group/section/stage labels, after this is merged, this will now correctly copy them over. That might be unexpected to MR authors but is the original impact when we added Introduce a new `ApplyTypeLabelFromRelatedIssue... (!1260 - merged).

Action items

Edited by Kev Kloss

Merge request reports