diff options
Diffstat (limited to 'db/fixtures/development/33_triage_ops.rb')
-rw-r--r-- | db/fixtures/development/33_triage_ops.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/db/fixtures/development/33_triage_ops.rb b/db/fixtures/development/33_triage_ops.rb index 1bb1f6c05d9..aaf92315125 100644 --- a/db/fixtures/development/33_triage_ops.rb +++ b/db/fixtures/development/33_triage_ops.rb @@ -30,6 +30,10 @@ class Gitlab::Seeder::TriageOps puts "Setting up webhooks" ensure_webhook_for('gitlab-com') ensure_webhook_for('gitlab-org') + + puts "Ensuring work type labels" + ensure_work_type_labels_for('gitlab-com') + ensure_work_type_labels_for('gitlab-org') end end @@ -83,6 +87,38 @@ class Gitlab::Seeder::TriageOps puts "Hook with url '#{hook.url}' and token '#{hook.token}' for '#{group_path}' is present now." end + def ensure_work_type_labels_for(group_path) + label_titles = [ + 'bug::availability', + 'bug::mobile', + 'bug::performance', + 'bug::vulnerability', + 'feature::addition', + 'feature::consolidation', + 'feature::enhancement', + 'feature::removal', + 'maintenance::dependency', + 'maintenance::pipelines', + 'maintenance::refactor', + 'maintenance::test-gap', + 'maintenance::usability', + 'maintenance::workflow', + 'type::bug', + 'type::feature', + 'type::maintenance', + ] + + group = Group.find_by_full_path(group_path) + + label_titles.each do |label_title| + color = ::Gitlab::Color.color_for(label_title[/[^:]+/]) + + Labels::CreateService + .new(title: label_title, color: "#{color}") + .execute(group: group) + end + end + def ensure_group(full_path) group = Group.find_by_full_path(full_path) |