Commit 1bc15049 authored by Etienne Baqué's avatar Etienne Baqué

Merge branch 'kassio/remove-export_reduce_relation_batch_size-flag' into 'master'

Remove export_reduce_relation_batch_size feature flag

See merge request gitlab-org/gitlab!79132
parents fdbca440 7db41ada
---
name: export_reduce_relation_batch_size
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/34057
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/282245
milestone: '13.1'
type: development
group: group::import
default_enabled: false
...@@ -6,15 +6,10 @@ module Gitlab ...@@ -6,15 +6,10 @@ module Gitlab
class StreamingSerializer class StreamingSerializer
include Gitlab::ImportExport::CommandLineUtil include Gitlab::ImportExport::CommandLineUtil
BATCH_SIZE = 100 BATCH_SIZE = 2
SMALLER_BATCH_SIZE = 2
def self.batch_size(exportable) def self.batch_size(exportable)
if Feature.enabled?(:export_reduce_relation_batch_size, exportable) BATCH_SIZE
SMALLER_BATCH_SIZE
else
BATCH_SIZE
end
end end
class Raw < String class Raw < String
......
...@@ -183,24 +183,8 @@ RSpec.describe Gitlab::ImportExport::Json::StreamingSerializer do ...@@ -183,24 +183,8 @@ RSpec.describe Gitlab::ImportExport::Json::StreamingSerializer do
end end
describe '.batch_size' do describe '.batch_size' do
context 'when export_reduce_relation_batch_size feature flag is enabled' do it 'returns default batch size' do
before do expect(described_class.batch_size(exportable)).to eq(described_class::BATCH_SIZE)
stub_feature_flags(export_reduce_relation_batch_size: true)
end
it 'returns 20' do
expect(described_class.batch_size(exportable)).to eq(described_class::SMALLER_BATCH_SIZE)
end
end
context 'when export_reduce_relation_batch_size feature flag is disabled' do
before do
stub_feature_flags(export_reduce_relation_batch_size: false)
end
it 'returns default batch size' do
expect(described_class.batch_size(exportable)).to eq(described_class::BATCH_SIZE)
end
end end
end end
end end
...@@ -8,35 +8,17 @@ RSpec.describe Gitlab::ImportExport::LegacyRelationTreeSaver do ...@@ -8,35 +8,17 @@ RSpec.describe Gitlab::ImportExport::LegacyRelationTreeSaver do
let(:tree) { {} } let(:tree) { {} }
describe '#serialize' do describe '#serialize' do
shared_examples 'FastHashSerializer with batch size' do |batch_size| let(:serializer) { instance_double(Gitlab::ImportExport::FastHashSerializer) }
let(:serializer) { instance_double(Gitlab::ImportExport::FastHashSerializer) }
it 'uses FastHashSerializer' do it 'uses FastHashSerializer' do
expect(Gitlab::ImportExport::FastHashSerializer) expect(Gitlab::ImportExport::FastHashSerializer)
.to receive(:new) .to receive(:new)
.with(exportable, tree, batch_size: batch_size) .with(exportable, tree, batch_size: Gitlab::ImportExport::Json::StreamingSerializer::BATCH_SIZE)
.and_return(serializer) .and_return(serializer)
expect(serializer).to receive(:execute) expect(serializer).to receive(:execute)
relation_tree_saver.serialize(exportable, tree) relation_tree_saver.serialize(exportable, tree)
end
end
context 'when export_reduce_relation_batch_size feature flag is enabled' do
before do
stub_feature_flags(export_reduce_relation_batch_size: true)
end
include_examples 'FastHashSerializer with batch size', Gitlab::ImportExport::Json::StreamingSerializer::SMALLER_BATCH_SIZE
end
context 'when export_reduce_relation_batch_size feature flag is disabled' do
before do
stub_feature_flags(export_reduce_relation_batch_size: false)
end
include_examples 'FastHashSerializer with batch size', Gitlab::ImportExport::Json::StreamingSerializer::BATCH_SIZE
end end
end end
end end
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