Class: Gitlab::IssuesLabels

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/issues_labels.rb

Class Method Summary collapse

Class Method Details

.generate(project) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/gitlab/issues_labels.rb', line 6

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