Commit 636c5923 authored by Alejandro Rodríguez's avatar Alejandro Rodríguez

Fix multiple repository storage paths after CE merge

parent eaa5507e
......@@ -147,7 +147,7 @@ class ApplicationSetting < ActiveRecord::Base
send_user_confirmation_email: false,
container_registry_token_expire_delay: 5,
elasticsearch_host: ENV['ELASTIC_HOST'] || 'localhost',
elasticsearch_port: ENV['ELASTIC_PORT'] || '9200'
elasticsearch_port: ENV['ELASTIC_PORT'] || '9200',
repository_storage: 'default',
)
end
......
......@@ -94,22 +94,6 @@ class Namespace < ActiveRecord::Base
raise Exception.new('Namespace cannot be moved, because at least one project has tags in container registry')
end
<<<<<<< HEAD
if gitlab_shell.mv_namespace(path_was, path)
Gitlab::UploadsTransfer.new.rename_namespace(path_was, path)
Gitlab::PagesTransfer.new.rename_namespace(path_was, path)
# If repositories moved successfully we need to
# send update instructions to users.
# However we cannot allow rollback since we moved namespace dir
# So we basically we mute exceptions in next actions
begin
send_update_instructions
rescue
# Returning false does not rollback after_* transaction but gives
# us information about failing some of tasks
false
=======
# Move the namespace directory in all storages paths used by member projects
repository_storage_paths.each do |repository_storage_path|
# Ensure old directory exists before moving it
......@@ -119,11 +103,11 @@ class Namespace < ActiveRecord::Base
# if we cannot move namespace directory we should rollback
# db changes in order to prevent out of sync between db and fs
raise Exception.new('namespace directory cannot be moved')
>>>>>>> 557ca2b31ff503b36a4b65af2641fcd0f5682d5b
end
end
Gitlab::UploadsTransfer.new.rename_namespace(path_was, path)
Gitlab::PagesTransfer.new.rename_namespace(path_was, path)
# If repositories moved successfully we need to
# send update instructions to users.
......
......@@ -1106,7 +1106,7 @@ describe Project, models: true do
let(:mirror) { false }
before do
allow_any_instance_of(Gitlab::Shell).to receive(:import_repository).with(project.path_with_namespace, project.import_url).and_return(true)
allow_any_instance_of(Gitlab::Shell).to receive(:import_repository).with(project.repository_storage_path, project.path_with_namespace, project.import_url).and_return(true)
allow(project).to receive(:repository_exists?).and_return(true)
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