debian-mirror-gitlab/db/fixtures/development/24_forks.rb

28 lines
628 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
require './spec/support/sidekiq'
Sidekiq::Testing.inline! do
Gitlab::Seeder.quiet do
User.all.sample(10).each do |user|
source_project = Project.public_only.sample
##
2019-12-04 20:38:33 +05:30
# 03_project.rb might not have created a public project because
2019-02-15 15:39:39 +05:30
# we use randomized approach (e.g. `Array#sample`).
return unless source_project
2019-12-04 20:38:33 +05:30
fork_project = Projects::ForkService.new(
source_project,
user,
namespace: user.namespace,
skip_disk_validation: true
).execute
2019-02-15 15:39:39 +05:30
if fork_project.valid?
2019-09-30 21:07:59 +05:30
print '.'
2019-02-15 15:39:39 +05:30
else
2019-09-30 21:07:59 +05:30
print 'F'
2019-02-15 15:39:39 +05:30
end
end
end
end