diff options
author | Stan Hu <stanhu@gmail.com> | 2016-05-04 10:59:20 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-05-04 19:22:01 +0300 |
commit | b9672d4b38514a14cc39773d30f55c9629973f63 (patch) | |
tree | a31621ec1cb606c191b9d861b6d1e27a66a20f25 /db | |
parent | 1a9d50597262a31f03dc66584f05d66b905d9d59 (diff) |
Limit the number of merge requests per project to avoid long seeds
This step was taking a long time because seed_fu creates N / 2 merge requests
for each repo, where N is the number of branches for that repo. At the time of
this writing, there are 234 branches on the gitlab-ce repo, leading to 117
merge requests.
Diffstat (limited to 'db')
-rw-r--r-- | db/fixtures/development/10_merge_requests.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/db/fixtures/development/10_merge_requests.rb b/db/fixtures/development/10_merge_requests.rb index 0825776ffaa..87fb8e3300d 100644 --- a/db/fixtures/development/10_merge_requests.rb +++ b/db/fixtures/development/10_merge_requests.rb @@ -1,6 +1,9 @@ Gitlab::Seeder.quiet do + # Limit the number of merge requests per project to avoid long seeds + MAX_NUM_MERGE_REQUESTS = 10 + Project.all.reject(&:empty_repo?).each do |project| - branches = project.repository.branch_names + branches = project.repository.branch_names.sample(MAX_NUM_MERGE_REQUESTS * 2) branches.each do |branch_name| break if branches.size < 2 |