diff options
Diffstat (limited to 'app/services/bulk_imports/create_service.rb')
-rw-r--r-- | app/services/bulk_imports/create_service.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/services/bulk_imports/create_service.rb b/app/services/bulk_imports/create_service.rb index 1cea7632aa1..c1becbb5609 100644 --- a/app/services/bulk_imports/create_service.rb +++ b/app/services/bulk_imports/create_service.rb @@ -52,7 +52,11 @@ module BulkImports def create_bulk_import BulkImport.transaction do - bulk_import = BulkImport.create!(user: current_user, source_type: 'gitlab') + bulk_import = BulkImport.create!( + user: current_user, + source_type: 'gitlab', + source_version: client.instance_version + ) bulk_import.create_configuration!(credentials.slice(:url, :access_token)) params.each do |entity| @@ -68,5 +72,12 @@ module BulkImports bulk_import end end + + def client + @client ||= BulkImports::Clients::HTTP.new( + url: @credentials[:url], + token: @credentials[:access_token] + ) + end end end |