GitLab adds Scoped Labels

Posted by Adrian Moisey on May 1, 2019

GitLab adds Scoped Labels

Scoped labels were introduced in GitLab 11.10.

These can only be used in GitLab Premium/Silver (and Ultimate/Gold), which is unfortunate because none of my private projects are on that level.

Scoped labels are mutually exclusive labels that share a namespace (or scope). These are created with the format of <scope>::<name> (note the double ::).

Two scoped labels with the same scope but a different value cannot be simultaneously added apply to an issue.

Example use case

You might want to have labels that indicate the priority of an issue. You can create multiple labels with the same scope: priority::high, priority::medium and priority::low This would mean that if you have an issue with a medium priority and changed it to high, GitLab will automatically remove the medium label for you. Handy!

GitLab’s documentation also has an example for using these labels with their Issue Board in the documentation

Improvement I’d like to see

I can’t currently find a way to search scoped labels by their scope. For example, I may want to search for all labels beginning in priority::. I hope GitLab adds functionality around that.