Commit e12b81ad authored by James Lopez's avatar James Lopez

update EE files to remove old storage logic

parent 29953ced
...@@ -28,16 +28,12 @@ module EE ...@@ -28,16 +28,12 @@ module EE
::RepositoryImportWorker.new.perform(export_into_project_id) ::RepositoryImportWorker.new.perform(export_into_project_id)
ensure ensure
export_file.close if export_file.respond_to?(:close) export_file.close if export_file.respond_to?(:close)
project.remove_exported_project_file project.remove_exports
end end
def export_file def export_file
strong_memoize(:export_file) do strong_memoize(:export_file) do
if object_storage? project.import_export_upload.export_file&.file
project.import_export_upload.export_file&.file
else
File.open(project.export_project_path)
end
end end
end end
......
...@@ -71,23 +71,8 @@ describe ProjectsController do ...@@ -71,23 +71,8 @@ describe ProjectsController do
stub_ee_application_setting(custom_project_templates_group_id: group.id) stub_ee_application_setting(custom_project_templates_group_id: group.id)
end end
context 'old upload' do
before do
stub_feature_flags(import_export_object_storage: false)
end
it 'creates the project from project template' do
post :create, project: templates_params
created_project = Project.find_by_path('foo')
expect(flash[:notice]).to eq "Project 'foo' was successfully created."
expect(created_project.repository.empty?).to be false
end
end
context 'object storage' do context 'object storage' do
before do before do
stub_feature_flags(import_export_object_storage: true)
stub_uploads_object_storage(FileUploader) stub_uploads_object_storage(FileUploader)
end end
......
...@@ -42,7 +42,7 @@ describe EE::Gitlab::ImportExport::AfterExportStrategies::CustomTemplateExportIm ...@@ -42,7 +42,7 @@ describe EE::Gitlab::ImportExport::AfterExportStrategies::CustomTemplateExportIm
end end
it 'removes the exported project file after the import' do it 'removes the exported project file after the import' do
expect(project_template).to receive(:remove_exported_project_file) expect(project_template).to receive(:remove_exports)
subject.execute(user, project_template) subject.execute(user, project_template)
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