Archive Labels: Prevent adding archived labels

What does this MR do and why?

#4233 added the attribute :archived to Labels and !198689 (merged) made sure that archived labels do not show up in the auto completion when using /label ~.... This MR makes sure that you cannot add archived labels when typing them in by hand in /label ... or /relabel ... commands.

The related issue is Remove archived labels from quick actions and a... (#554226 - closed).

🛠️ with ❤️ at Siemens

References

Screenshots or screen recordings

failed

How to set up and validate locally

  1. Enable feature flag with rails c:
 Feature.enable(:labels_archive)
  1. Archive a label: Go to Any project > Manage > Labels and edit a label in the three dot dropdown. Check the Archived checkbox and save the label.
  2. Now add a comment to any issue with /label ~<your archived label> or /relabel ~<your archived label>. You should see that the label is not applied and there is an error instead.

MR acceptance checklist

checklist

Related to #4233

Edited by Nicholas Wittstruck

Merge request reports

Loading