diff options
author | Robert Speicher <robert@gitlab.com> | 2016-05-04 17:56:57 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-05-04 17:56:57 +0000 |
commit | 8aa29a5d736d2c0d195ea8de453743c00e33ce36 (patch) | |
tree | a9aff1fda7c382cb31ca4c817c186dc8d24c9eb2 | |
parent | 585f5cfa3359496733b5bd344ae89f98b5578865 (diff) | |
parent | b9672d4b38514a14cc39773d30f55c9629973f63 (diff) | |
download | gitlab-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.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 |