Commit ff7a8435 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'filter-out-mass-projects-from-fixtures' into 'master'

Reduce number mass inserts

See merge request gitlab-org/gitlab!83856
parents a91de216 431723a9
......@@ -4,7 +4,7 @@ class Gitlab::Seeder::Users
include ActionView::Helpers::NumberHelper
RANDOM_USERS_COUNT = 20
MASS_NAMESPACES_COUNT = 100
MASS_NAMESPACES_COUNT = ENV['CI'] ? 1 : 100
MASS_USERS_COUNT = ENV['CI'] ? 10 : 1_000_000
attr_reader :opts
......
......@@ -13,7 +13,7 @@ class Gitlab::Seeder::ProjectFeatures
Gitlab::Seeder.with_mass_insert(Project.count, "Project features") do
Project.each_batch(of: BATCH_SIZE) do |batch, index|
range = batch.pluck(Arel.sql('MIN(id)'), Arel.sql('MAX(id)')).first
count = index * BATCH_SIZE
count = index * batch.size
Gitlab::Seeder.log_message("Creating project features: #{count}.")
ActiveRecord::Base.connection.execute <<~SQL
......
......@@ -13,7 +13,7 @@ class Gitlab::Seeder::ProjectRoutes
Gitlab::Seeder.with_mass_insert(Project.count, "Project routes") do
Project.each_batch(of: BATCH_SIZE / 2) do |batch, index|
range = batch.pluck(Arel.sql('MIN(id)'), Arel.sql('MAX(id)')).first
count = index * BATCH_SIZE / 2
count = index * batch.size
Gitlab::Seeder.log_message("Creating project routes: #{count}.")
ActiveRecord::Base.connection.execute <<~SQL
......
......@@ -139,7 +139,7 @@ Gitlab::Seeder.quiet do
flag = 'SEED_PRODUCTIVITY_ANALYTICS'
if ENV[flag]
Project.find_each do |project|
Project.not_mass_generated.find_each do |project|
# This seed naively assumes that every project has a repository, and every
# repository has a `master` branch, which may be the case for a pristine
# GDK seed, but is almost never true for a GDK that's actually had
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment