Commit 66f4082d authored by Jan Provaznik's avatar Jan Provaznik

Merge branch 'prepare-group-tree-saver-to-ndjson' into 'master'

Prepare `...Group::Treesaver` to ndjson

See merge request gitlab-org/gitlab!29576
parents 4de027be 38b2d37e
...@@ -56,7 +56,12 @@ module Groups ...@@ -56,7 +56,12 @@ module Groups
end end
def tree_exporter def tree_exporter
Gitlab::ImportExport::Group::TreeSaver.new(group: @group, current_user: @current_user, shared: @shared, params: @params) Gitlab::ImportExport::Group::LegacyTreeSaver.new(
group: @group,
current_user: @current_user,
shared: @shared,
params: @params
)
end end
def file_saver def file_saver
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::ImportExport::Group::TreeSaver do describe Gitlab::ImportExport::Group::LegacyTreeSaver do
describe 'saves the group tree into a json object' do describe 'saves the group tree into a json object' do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Gitlab module Gitlab
module ImportExport module ImportExport
module Group module Group
class TreeSaver class LegacyTreeSaver
attr_reader :full_path, :shared attr_reader :full_path, :shared
def initialize(group:, current_user:, shared:, params: {}) def initialize(group:, current_user:, shared:, params: {})
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::ImportExport::Group::TreeSaver do describe Gitlab::ImportExport::Group::LegacyTreeSaver do
describe 'saves the group tree into a json object' do describe 'saves the group tree into a json object' do
let(:shared) { Gitlab::ImportExport::Shared.new(group) } let(:shared) { Gitlab::ImportExport::Shared.new(group) }
let(:group_tree_saver) { described_class.new(group: group, current_user: user, shared: shared) } let(:group_tree_saver) { described_class.new(group: group, current_user: user, shared: shared) }
...@@ -28,7 +28,7 @@ describe Gitlab::ImportExport::Group::TreeSaver do ...@@ -28,7 +28,7 @@ describe Gitlab::ImportExport::Group::TreeSaver do
# except: # except:
# context 'with description override' do # context 'with description override' do
# context 'group members' do # context 'group members' do
# ^ These are specific for the Group::TreeSaver # ^ These are specific for the Group::LegacyTreeSaver
context 'JSON' do context 'JSON' do
let(:saved_group_json) do let(:saved_group_json) do
group_tree_saver.save group_tree_saver.save
......
...@@ -50,7 +50,7 @@ describe Groups::ImportExport::ExportService do ...@@ -50,7 +50,7 @@ describe Groups::ImportExport::ExportService do
end end
it 'saves the models' do it 'saves the models' do
expect(Gitlab::ImportExport::Group::TreeSaver).to receive(:new).and_call_original expect(Gitlab::ImportExport::Group::LegacyTreeSaver).to receive(:new).and_call_original
service.execute service.execute
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