Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

changing the default issue labels

Tags:

gitlab

I want to change the default issue labels. I tried modifying the code in the lib/gitlab/issues_labels.rb which I thought was where it was generating the default labels. however that didn't actually work. Does anyone know how to change the default labels that are created for a project?

like image 886
CowboyB Avatar asked Mar 05 '14 00:03

CowboyB


2 Answers

Gitlab 5.2.0 (May 2013) introduced the "Ability to generate default labels set for issues".

It comes from commit 71647fd, with issues_labels.rb

 labels = important_labels + warning_labels + neutral_labels + positive_labels
 project.issues_default_label_list = labels

So modifying those labels lib/gitlab/issues_labels.rb should indeed be the right solution, but you might have to completely stop/restart your Gitlab instance in order to see the changes, because they could be set when launching Gitlab, and not modified later (even if the code changes)..

like image 127
VonC Avatar answered Oct 24 '22 16:10

VonC


Hello from the year 2020!

You can create a default set of labels for new projects in the admin area for your GitLab instance.

Once you've created a set of labels there, brand new projects will automatically have them available from the start, and you won't see the "Generate a default set of labels" button anymore.

Screenshot of per-project label settings in GitLab circa 2020

For existing projects, it would be nice if the "Generate a default set of labels" button would use the set of tags you've defined in the admin area. But that is not the case.

For existing projects, when you click that button, you'll still get the set of "default" labels from lib/gitlab/issues_labels.rb (the code looks a bit different in 2020, but they're still hard-coded), regardless of whether there are any site-wide labels set up in the admin area.

Edit: As of this writing, there are currently no open issues addressing this inconsistency, so if it's really bothering you, you could create one.

like image 34
TheDudeAbides Avatar answered Oct 24 '22 16:10

TheDudeAbides