gitlab-org--gitlab-foss/lib/gitlab/issues_labels.rb
Adam Niedzielski e2c603696a Pass user instance to Labels::FindOrCreateService or skip_authorization: true
Do not pass project.owner because it may return a group and Labels::FindOrCreateService
throws an error in this case.
Fixes #23694.
2016-10-28 11:31:45 +02:00

27 lines
762 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(nil, project, params).execute(skip_authorization: true)
end
end
end
end
end