changing the default issue labels

谁都会走 提交于 2020-05-13 05:09:51

问题


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?


回答1:


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)..




回答2:


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.

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.



来源:https://stackoverflow.com/questions/22186140/changing-the-default-issue-labels

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!