gitlab-org--gitlab-foss/lib/gitlab/issues_labels.rb
Stan Hu 0890aeb61a Fix error in generating labels
Attempting to generate default set of labels would result in
an error:

ArgumentError: wrong number of arguments (given 1, expected 0)

Closes #23649
2016-10-22 02:16:21 -07:00

27 lines
746 B
Ruby

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 }
]
labels.each do |params|
::Labels::FindOrCreateService.new(project.owner, project, params).execute
end
end
end
end
end