2013-05-07 10:57:59 -04:00
|
|
|
module Gitlab
|
2013-05-07 12:26:41 -04:00
|
|
|
class IssuesLabels
|
2013-05-07 10:57:59 -04:00
|
|
|
class << self
|
2013-05-07 12:26:41 -04:00
|
|
|
def generate(project)
|
2014-07-29 15:19:47 -04: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 10:57:59 -04:00
|
|
|
|
2016-10-17 22:27:10 -04:00
|
|
|
labels.each do |params|
|
2016-10-28 05:31:45 -04:00
|
|
|
::Labels::FindOrCreateService.new(nil, project, params).execute(skip_authorization: true)
|
2014-07-29 12:19:26 -04:00
|
|
|
end
|
2013-05-07 10:57:59 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|