Hide archived labels from auto completion
-
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?
This MR hides archived labels from auto completion. It's a follow-up to !196443 (merged) that added the ability to archive labels.
It's behind a feature flag called labels_archive.
References
Screenshots or screen recordings
After enabling the feature flag and archiving the label named Brische:
| Before | After |
|---|---|
![]() |
![]() |
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 go to any issue in this project. In a comment, type
/label ~and wait for the auto-completion to show up. The archived label should now be hidden. - Auto-completions are cached for three minutes - you can reduce the cache to a second by editing
app/controllers/concerns/autocomplete_sources/expires_in.rband settingAUTOCOMPLETE_EXPIRES_IN = 1.second
MR acceptance checklist
MR Checklist ( @nwittstruck)
-
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 #554226 (closed)
Edited by Nicholas Wittstruck

