Archive Labels: Prevent adding archived labels
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
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).
References
- Remove archived labels from quick actions and a... (#554226 - closed)
- Archived labels (#4233)
- Hide archived labels from auto completion (!198689 - merged)
Screenshots or screen recordings
How to set up and validate locally
- Enable feature flag with
rails c:
Feature.enable(:labels_archive)
- Archive a label: Go to
Any project > Manage > Labelsand edit a label in thethree dot dropdown. Check theArchivedcheckbox and save the label. - 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
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the javascript style guides -
Conforms to the database guides
Related to #4233
Edited by Nicholas Wittstruck
