diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /lib/bulk_imports/pipeline.rb | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'lib/bulk_imports/pipeline.rb')
-rw-r--r-- | lib/bulk_imports/pipeline.rb | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/lib/bulk_imports/pipeline.rb b/lib/bulk_imports/pipeline.rb index df4f020d6b2..f27818dae18 100644 --- a/lib/bulk_imports/pipeline.rb +++ b/lib/bulk_imports/pipeline.rb @@ -8,8 +8,11 @@ module BulkImports include Runner NotAllowedError = Class.new(StandardError) + ExpiredError = Class.new(StandardError) + FailedError = Class.new(StandardError) CACHE_KEY_EXPIRATION = 2.hours + NDJSON_EXPORT_TIMEOUT = 30.minutes def initialize(context) @context = context @@ -19,6 +22,18 @@ module BulkImports @tracker ||= context.tracker end + def portable + @portable ||= context.portable + end + + def import_export_config + @import_export_config ||= context.import_export_config + end + + def current_user + @current_user ||= context.current_user + end + included do private @@ -111,7 +126,7 @@ module BulkImports options = class_config[:options] if options - class_config[:klass].new(class_config[:options]) + class_config[:klass].new(**class_config[:options]) else class_config[:klass].new end @@ -155,6 +170,22 @@ module BulkImports class_attributes[:abort_on_failure] end + def ndjson_pipeline! + class_attributes[:ndjson_pipeline] = true + end + + def ndjson_pipeline? + class_attributes[:ndjson_pipeline] + end + + def relation_name(name) + class_attributes[:relation_name] = name + end + + def relation + class_attributes[:relation_name] + end + private def add_attribute(sym, klass, options) |