2012-11-13 15:11:56 -05:00
|
|
|
Gitlab::Seeder.quiet do
|
2014-05-05 08:07:19 -04:00
|
|
|
Project.all.reject(&:empty_repo?).each do |project|
|
|
|
|
branches = project.repository.branch_names
|
|
|
|
|
|
|
|
branches.each do |branch_name|
|
|
|
|
break if branches.size < 2
|
|
|
|
source_branch = branches.pop
|
|
|
|
target_branch = branches.pop
|
|
|
|
|
|
|
|
params = {
|
|
|
|
source_branch: source_branch,
|
|
|
|
target_branch: target_branch,
|
|
|
|
title: Faker::Lorem.sentence(6),
|
2014-08-11 10:55:31 -04:00
|
|
|
description: Faker::Lorem.sentences(3).join(" "),
|
|
|
|
milestone: project.milestones.sample,
|
|
|
|
assignee: project.team.users.sample
|
2014-05-05 08:07:19 -04:00
|
|
|
}
|
|
|
|
|
2014-08-11 10:55:31 -04:00
|
|
|
MergeRequests::CreateService.new(project, project.team.users.sample, params).execute
|
|
|
|
print '.'
|
2013-10-04 15:11:50 -04:00
|
|
|
end
|
2012-11-13 15:11:56 -05:00
|
|
|
end
|
2014-09-29 07:55:31 -04:00
|
|
|
|
2014-09-30 11:34:46 -04:00
|
|
|
project = Project.find_with_namespace('gitlab-org/gitlab-test')
|
2014-09-29 07:55:31 -04:00
|
|
|
|
|
|
|
params = {
|
|
|
|
source_branch: 'feature',
|
|
|
|
target_branch: 'master',
|
|
|
|
title: 'Can be automatically merged'
|
|
|
|
}
|
|
|
|
MergeRequests::CreateService.new(project, User.admins.first, params).execute
|
|
|
|
print '.'
|
|
|
|
|
|
|
|
params = {
|
|
|
|
source_branch: 'feature_conflict',
|
|
|
|
target_branch: 'feature',
|
|
|
|
title: 'Cannot be automatically merged'
|
|
|
|
}
|
|
|
|
MergeRequests::CreateService.new(project, User.admins.first, params).execute
|
|
|
|
print '.'
|
2012-10-30 04:03:21 -04:00
|
|
|
end
|