2017-08-17 22:00:37 +05:30
|
|
|
require './spec/support/sidekiq'
|
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
Gitlab::Seeder.quiet do
|
|
|
|
Project.all.each do |project|
|
2015-10-24 18:46:33 +05:30
|
|
|
10.times do
|
2019-05-18 00:54:41 +05:30
|
|
|
label_ids = project.labels.pluck(:id).sample(3)
|
|
|
|
label_ids += project.group.labels.sample(3) if project.group
|
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
issue_params = {
|
2015-09-11 14:41:01 +05:30
|
|
|
title: FFaker::Lorem.sentence(6),
|
|
|
|
description: FFaker::Lorem.sentence,
|
2014-09-02 18:07:02 +05:30
|
|
|
state: ['opened', 'closed'].sample,
|
|
|
|
milestone: project.milestones.sample,
|
2018-12-13 13:39:08 +05:30
|
|
|
assignees: [project.team.users.sample],
|
2019-05-18 00:54:41 +05:30
|
|
|
created_at: rand(12).months.ago,
|
|
|
|
label_ids: label_ids
|
2014-09-02 18:07:02 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
Issues::CreateService.new(project, project.team.users.sample, issue_params).execute
|
|
|
|
print '.'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|