Add lock_on_merge support for scoped labels
What does this MR do and why?
Adds support for :enforce_locked_labels_on_merge
feature flag to scoped labels.
This means when a label is marked as locked, it cannot be deleted from any merged MR. Now this works for scoped labels.
Related to https://gitlab.com/gitlab-org/gitlab/-/issues/408676+
How to set up and validate locally
- Enable the feature flag:
Feature.enable(:enforce_locked_labels_on_merge)
- Visit a group or project label list and create two or three scoped labels, such as
workflow::ready
,workflow::dev
, andworkflow::production
. - Edit each scoped label and click the checkbox to lock it.
- Choose an issue (or un-merged MR), and add a scoped label to it. You should be able to remove the label, change from one to the other, etc. Normal behavior
- Choose a merged MR, and add scoped label. You should not be able to delete it or change it to another scoped label. You should be able to freely add/delete any non-locked label.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Brett Walker