Creating a Group label with the same name as a Project label. Then delete the Project label. Deletes all associated labels.
Summary
We currently don't have this functionality gitlab-ce#24021 - So I went about it manually. After creating a Group label with the same name as a project label, all seemed well. Both labels displayed the issue count.
However, when you delete the project label, all labels disappear from the project the label was assigned to.
gitlab-ce#24021 may fix this issue, but I have a feeling if you don't use the promote button (because perhaps you didn't know it was there) - It's likely you'll still get caught out.
Steps to reproduce
- Create a project label
- Assign the project label to an issue
- Create a group label with the same name
- Delete the project label
What is the current bug behavior?
The label is removed from the projects, without checking whether there is a superseding label.
What is the expected correct behavior?
The label should remain assigned to the project.
Results of GitLab environment info
GitLab Enterprise Edition 8.16.1-ee gitlab-ce@060f824bd7be41ffc05af04def53f20e3a870ca7
Possible fixes
Before deleting the labels from the projects, check if there are any other labels with the same name across the groups / project, only delete if the query yields no results.
