diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-06-19 12:17:54 +0200 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-06-19 13:30:54 +0200 |
commit | 1dc0332726ffbcb488439e84373958753ee4ac5e (patch) | |
tree | 7d8d0b00364add99eefe09f86e90f7bcadfc1746 /app/workers | |
parent | 0bf6279c09a8ae8ae099aa436adf04782cc1d0f9 (diff) | |
download | gitlab-ce-1dc0332726ffbcb488439e84373958753ee4ac5e.tar.gz |
Move forking to Gitalyzj-fork-mandatory
Closes https://gitlab.com/gitlab-org/gitaly/issues/817
Closes https://gitlab.com/gitlab-org/gitaly/issues/1236
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/repository_fork_worker.rb | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/app/workers/repository_fork_worker.rb b/app/workers/repository_fork_worker.rb index db48bb7e8b8..dbb215f1964 100644 --- a/app/workers/repository_fork_worker.rb +++ b/app/workers/repository_fork_worker.rb @@ -8,28 +8,12 @@ class RepositoryForkWorker target_project_id = args.shift target_project = Project.find(target_project_id) - # By v10.8, we should've drained the queue of all jobs using the old arguments. - # We can remove the else clause if we're no longer logging the message in that clause. - # See https://gitlab.com/gitlab-org/gitaly/issues/1110 - if args.empty? - source_project = target_project.forked_from_project - unless source_project - return target_project.mark_import_as_failed('Source project cannot be found.') - end - - fork_repository(target_project, source_project.repository_storage, source_project.disk_path) - else - Rails.logger.info("Project #{target_project.id} is being forked using old-style arguments.") - - source_repository_storage_path, source_disk_path = *args - - source_repository_storage_name = Gitlab::GitalyClient::StorageSettings.allow_disk_access do - Gitlab.config.repositories.storages.find do |_, info| - info.legacy_disk_path == source_repository_storage_path - end&.first || raise("no shard found for path '#{source_repository_storage_path}'") - end - fork_repository(target_project, source_repository_storage_name, source_disk_path) + source_project = target_project.forked_from_project + unless source_project + return target_project.mark_import_as_failed('Source project cannot be found.') end + + fork_repository(target_project, source_project.repository_storage, source_project.disk_path) end private |