summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-05-04 17:56:57 +0000
committerRobert Speicher <robert@gitlab.com>2016-05-04 17:56:57 +0000
commit8aa29a5d736d2c0d195ea8de453743c00e33ce36 (patch)
treea9aff1fda7c382cb31ca4c817c186dc8d24c9eb2
parent585f5cfa3359496733b5bd344ae89f98b5578865 (diff)
parentb9672d4b38514a14cc39773d30f55c9629973f63 (diff)
downloadgitlab-ce-8aa29a5d736d2c0d195ea8de453743c00e33ce36.tar.gz
Merge branch 'limit-mr-seedfu' into 'master'
Limit the number of merge requests per project to avoid long seeds in development environment 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. See merge request !4032
-rw-r--r--db/fixtures/development/10_merge_requests.rb5
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