Commit 7db41ada authored by Kassio Borges's avatar Kassio Borges

Remove export_reduce_relation_batch_size feature flag

Changelog: changed
parent f43fcde5
---
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,16 +6,11 @@ module Gitlab ...@@ -6,16 +6,11 @@ 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)
SMALLER_BATCH_SIZE
else
BATCH_SIZE BATCH_SIZE
end end
end
class Raw < String class Raw < String
def to_json(*_args) def to_json(*_args)
......
...@@ -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
before do
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 it 'returns default batch size' do
expect(described_class.batch_size(exportable)).to eq(described_class::BATCH_SIZE) expect(described_class.batch_size(exportable)).to eq(described_class::BATCH_SIZE)
end end
end end
end
end end
...@@ -8,13 +8,12 @@ RSpec.describe Gitlab::ImportExport::LegacyRelationTreeSaver do ...@@ -8,13 +8,12 @@ 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)
...@@ -22,21 +21,4 @@ RSpec.describe Gitlab::ImportExport::LegacyRelationTreeSaver do ...@@ -22,21 +21,4 @@ RSpec.describe Gitlab::ImportExport::LegacyRelationTreeSaver do
relation_tree_saver.serialize(exportable, tree) relation_tree_saver.serialize(exportable, tree)
end end
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
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