diff options
Diffstat (limited to 'lib/bulk_imports')
4 files changed, 12 insertions, 15 deletions
diff --git a/lib/bulk_imports/clients/http.rb b/lib/bulk_imports/clients/http.rb index 037da5e0816..1d77757c4af 100644 --- a/lib/bulk_imports/clients/http.rb +++ b/lib/bulk_imports/clients/http.rb @@ -35,7 +35,7 @@ module BulkImports end def each_page(method, resource, query = {}, &block) - return to_enum(__method__, method, resource, query) unless block_given? + return to_enum(__method__, method, resource, query) unless block next_page = @page @@ -101,22 +101,19 @@ module BulkImports def default_options { - headers: request_headers, - follow_redirects: false + headers: { 'Content-Type' => 'application/json' }, + query: request_query, + follow_redirects: true, + resend_on_redirect: false, + limit: 2 } end def request_query { page: @page, - per_page: @per_page - } - end - - def request_headers - { - 'Content-Type' => 'application/json', - 'Authorization' => "Bearer #{@token}" + per_page: @per_page, + private_token: @token } end diff --git a/lib/bulk_imports/groups/transformers/group_attributes_transformer.rb b/lib/bulk_imports/groups/transformers/group_attributes_transformer.rb index 3067e0997c2..d9efcdb1ba5 100644 --- a/lib/bulk_imports/groups/transformers/group_attributes_transformer.rb +++ b/lib/bulk_imports/groups/transformers/group_attributes_transformer.rb @@ -38,7 +38,7 @@ module BulkImports end def transform_path(import_entity, data) - data['path'] = import_entity.destination_name.parameterize + data['path'] = import_entity.destination_slug.parameterize data end diff --git a/lib/bulk_imports/pipeline.rb b/lib/bulk_imports/pipeline.rb index dc2ebdddd14..68b86c68619 100644 --- a/lib/bulk_imports/pipeline.rb +++ b/lib/bulk_imports/pipeline.rb @@ -12,7 +12,7 @@ module BulkImports FailedError = Class.new(StandardError) CACHE_KEY_EXPIRATION = 2.hours - NDJSON_EXPORT_TIMEOUT = 30.minutes + NDJSON_EXPORT_TIMEOUT = 90.minutes def initialize(context) @context = context diff --git a/lib/bulk_imports/projects/transformers/project_attributes_transformer.rb b/lib/bulk_imports/projects/transformers/project_attributes_transformer.rb index 38730a7723b..205c3185f72 100644 --- a/lib/bulk_imports/projects/transformers/project_attributes_transformer.rb +++ b/lib/bulk_imports/projects/transformers/project_attributes_transformer.rb @@ -11,8 +11,8 @@ module BulkImports entity = context.entity visibility = data.delete('visibility') - project[:name] = entity.destination_name - project[:path] = entity.destination_name.parameterize + project[:name] = entity.destination_slug + project[:path] = entity.destination_slug.parameterize project[:created_at] = data['created_at'] project[:import_type] = PROJECT_IMPORT_TYPE project[:visibility_level] = Gitlab::VisibilityLevel.string_options[visibility] if visibility.present? |