2014-09-02 18:07:02 +05:30
|
|
|
module Gitlab
|
|
|
|
class IssuesLabels
|
|
|
|
class << self
|
|
|
|
def generate(project)
|
|
|
|
red = '#d9534f'
|
|
|
|
yellow = '#f0ad4e'
|
|
|
|
blue = '#428bca'
|
|
|
|
green = '#5cb85c'
|
|
|
|
|
|
|
|
labels = [
|
|
|
|
{ title: "bug", color: red },
|
|
|
|
{ title: "critical", color: red },
|
|
|
|
{ title: "confirmed", color: red },
|
|
|
|
{ title: "documentation", color: yellow },
|
|
|
|
{ title: "support", color: yellow },
|
|
|
|
{ title: "discussion", color: blue },
|
|
|
|
{ title: "suggestion", color: blue },
|
|
|
|
{ title: "enhancement", color: green }
|
|
|
|
]
|
|
|
|
|
2016-11-03 12:29:30 +05:30
|
|
|
labels.each do |params|
|
|
|
|
::Labels::FindOrCreateService.new(nil, project, params).execute(skip_authorization: true)
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|