summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2018-07-11 15:02:59 +0200
committerJames Lopez <james@jameslopez.es>2018-07-11 15:02:59 +0200
commitfa2e3162f8955eaa7259c17c080a083b5d9e8ba9 (patch)
treeb65fd54c3376d21e11271479c55d6f4e1f88c7f1
parent3c31de752027abfb247efc5c588496d329e5b47b (diff)
downloadgitlab-ce-fa2e3162f8955eaa7259c17c080a083b5d9e8ba9.tar.gz
added changelog, small refactor
-rw-r--r--changelogs/unreleased/48745-project-exports-fail-when-uploads-have-been-migrated-to-object-storage.yml5
-rw-r--r--lib/gitlab/import_export/uploads_manager.rb3
-rw-r--r--spec/lib/gitlab/import_export/avatar_saver_spec.rb2
-rw-r--r--spec/lib/gitlab/import_export/uploads_manager_spec.rb2
4 files changed, 6 insertions, 6 deletions
diff --git a/changelogs/unreleased/48745-project-exports-fail-when-uploads-have-been-migrated-to-object-storage.yml b/changelogs/unreleased/48745-project-exports-fail-when-uploads-have-been-migrated-to-object-storage.yml
new file mode 100644
index 00000000000..7552e0d3878
--- /dev/null
+++ b/changelogs/unreleased/48745-project-exports-fail-when-uploads-have-been-migrated-to-object-storage.yml
@@ -0,0 +1,5 @@
+---
+title: Add uploader support to Import/Export uploads
+merge_request: 20484
+author:
+type: added
diff --git a/lib/gitlab/import_export/uploads_manager.rb b/lib/gitlab/import_export/uploads_manager.rb
index b1ea7f19068..6af8620ccd0 100644
--- a/lib/gitlab/import_export/uploads_manager.rb
+++ b/lib/gitlab/import_export/uploads_manager.rb
@@ -47,11 +47,10 @@ module Gitlab
def copy_from_object_storage
return unless Gitlab::ImportExport.object_storage?
- return if uploads.empty?
uploads.each do |upload_model|
next unless upload_model.file
- next if upload_model.upload.local? # Already copied
+ next if upload_model.upload.local? # Already copied, using the old method
download_and_copy(upload_model)
end
diff --git a/spec/lib/gitlab/import_export/avatar_saver_spec.rb b/spec/lib/gitlab/import_export/avatar_saver_spec.rb
index 792596bfaa5..90e6d653d34 100644
--- a/spec/lib/gitlab/import_export/avatar_saver_spec.rb
+++ b/spec/lib/gitlab/import_export/avatar_saver_spec.rb
@@ -19,8 +19,6 @@ describe Gitlab::ImportExport::AvatarSaver do
it 'saves a project avatar' do
described_class.new(project: project_with_avatar, shared: shared).save
- puts "#{shared.export_path}/avatar/dk.png"
-
expect(File).to exist("#{shared.export_path}/avatar/dk.png")
end
diff --git a/spec/lib/gitlab/import_export/uploads_manager_spec.rb b/spec/lib/gitlab/import_export/uploads_manager_spec.rb
index 922f6f6376c..0c9c4574469 100644
--- a/spec/lib/gitlab/import_export/uploads_manager_spec.rb
+++ b/spec/lib/gitlab/import_export/uploads_manager_spec.rb
@@ -34,8 +34,6 @@ describe Gitlab::ImportExport::UploadsManager do
it 'copies the file in the correct location when there is an upload' do
manager.save
- puts exported_file_path
-
expect(File).to exist(exported_file_path)
end
end