2013-05-07 14:57:59 +00:00
|
|
|
module Gitlab
|
2013-05-07 16:26:41 +00:00
|
|
|
class IssuesLabels
|
2013-05-07 14:57:59 +00:00
|
|
|
class << self
|
2013-05-07 16:26:41 +00:00
|
|
|
def generate(project)
|
2014-07-29 19:19:47 +00:00
|
|
|
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 }
|
|
|
|
]
|
2013-05-07 14:57:59 +00:00
|
|
|
|
2016-10-18 02:27:10 +00:00
|
|
|
labels.each do |params|
|
2016-10-28 09:31:45 +00:00
|
|
|
::Labels::FindOrCreateService.new(nil, project, params).execute(skip_authorization: true)
|
2014-07-29 16:19:26 +00:00
|
|
|
end
|
2013-05-07 14:57:59 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|