Fix processing locked scoped labels
What does this MR do and why?
It was possible to try and add another scoped label through the dropdown, and if the current label was locked, it would still remove it, which is incorrect. It should not remove a locked label.
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.
- In the same MR, use the label dropdown to change the scoped label. This should now properly work and not remove the scoped 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.
Related to #408676
Edited by Brett Walker