diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-03 09:09:31 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-03 09:09:31 +0000 |
commit | 04baa85554ff13bdd4d6f4e6bb24119d17608fee (patch) | |
tree | 7cb9c0977e09d97da340f48703d79b2dbd3579a0 /lib | |
parent | 42f41de46525ce0065f02ee07c1a79f5669526a0 (diff) | |
download | gitlab-ce-04baa85554ff13bdd4d6f4e6bb24119d17608fee.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/github_import/parallel_importer.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/import/set_async_jid.rb | 11 | ||||
-rw-r--r-- | lib/gitlab/import_export/attributes_finder.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/import_export/fast_hash_serializer.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/import_export/project/import_export.yml | 5 | ||||
-rw-r--r-- | lib/gitlab/import_export/relation_tree_restorer.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/phabricator_import/importer.rb | 2 |
7 files changed, 18 insertions, 12 deletions
diff --git a/lib/gitlab/github_import/parallel_importer.rb b/lib/gitlab/github_import/parallel_importer.rb index cdd2abaeb4c..8fb99c996b3 100644 --- a/lib/gitlab/github_import/parallel_importer.rb +++ b/lib/gitlab/github_import/parallel_importer.rb @@ -31,7 +31,7 @@ module Gitlab end def execute - Gitlab::Import::SetAsyncJid.set_jid(project) + Gitlab::Import::SetAsyncJid.set_jid(project.import_state) Stage::ImportRepositoryWorker .perform_async(project.id) diff --git a/lib/gitlab/import/set_async_jid.rb b/lib/gitlab/import/set_async_jid.rb index 584d24045ee..3b11c92fb56 100644 --- a/lib/gitlab/import/set_async_jid.rb +++ b/lib/gitlab/import/set_async_jid.rb @@ -10,17 +10,18 @@ module Gitlab module Import module SetAsyncJid - def self.set_jid(project) - jid = generate_jid(project) + def self.set_jid(import_state) + jid = generate_jid(import_state) Gitlab::SidekiqStatus .set(jid, StuckImportJobsWorker::IMPORT_JOBS_EXPIRATION) - project.import_state.update_column(:jid, jid) + import_state.update_column(:jid, jid) end - def self.generate_jid(project) - "async-import/#{project.id}" + def self.generate_jid(import_state) + importer_name = import_state.class.name.underscore.dasherize + "async-import/#{importer_name}/#{import_state.project_id}" end end end diff --git a/lib/gitlab/import_export/attributes_finder.rb b/lib/gitlab/import_export/attributes_finder.rb index 28d48ce6dfe..bab473741b1 100644 --- a/lib/gitlab/import_export/attributes_finder.rb +++ b/lib/gitlab/import_export/attributes_finder.rb @@ -38,7 +38,7 @@ module Gitlab def resolve_preloads(model_key, model_tree) model_tree .map { |submodel_key, submodel_tree| resolve_preload(model_key, submodel_key, submodel_tree) } - .compact + .tap { |entries| entries.compact! } .to_h .deep_merge(@preloads[model_key].to_h) .presence diff --git a/lib/gitlab/import_export/fast_hash_serializer.rb b/lib/gitlab/import_export/fast_hash_serializer.rb index c5fb00ed741..e5d52f945b5 100644 --- a/lib/gitlab/import_export/fast_hash_serializer.rb +++ b/lib/gitlab/import_export/fast_hash_serializer.rb @@ -100,7 +100,7 @@ module Gitlab includes .map(&method(:serialize_include_definition)) - .compact + .tap { |entries| entries.compact! } .to_h end diff --git a/lib/gitlab/import_export/project/import_export.yml b/lib/gitlab/import_export/project/import_export.yml index 56f7ffbe4f8..06d7dd6f897 100644 --- a/lib/gitlab/import_export/project/import_export.yml +++ b/lib/gitlab/import_export/project/import_export.yml @@ -17,6 +17,7 @@ tree: - notes: - :author - :award_emoji + - :system_note_metadata - events: - :push_event_payload - label_links: @@ -47,6 +48,7 @@ tree: - notes: - :author - :award_emoji + - :system_note_metadata - events: - :push_event_payload - :suggestions @@ -323,6 +325,9 @@ excluded_attributes: epic_issue: - :epic_id - :issue_id + system_note_metadata: + - :description_version_id + - :note_id methods: notes: - :type diff --git a/lib/gitlab/import_export/relation_tree_restorer.rb b/lib/gitlab/import_export/relation_tree_restorer.rb index 7f25222ba41..78ed365cea0 100644 --- a/lib/gitlab/import_export/relation_tree_restorer.rb +++ b/lib/gitlab/import_export/relation_tree_restorer.rb @@ -142,9 +142,9 @@ module Gitlab end def build_relations(relation_key, relation_definition, data_hashes) - data_hashes.map do |data_hash| - build_relation(relation_key, relation_definition, data_hash) - end.compact + data_hashes + .map { |data_hash| build_relation(relation_key, relation_definition, data_hash) } + .tap { |entries| entries.compact! } end def build_relation(relation_key, relation_definition, data_hash) diff --git a/lib/gitlab/phabricator_import/importer.rb b/lib/gitlab/phabricator_import/importer.rb index c1797f4027e..ac85b96de08 100644 --- a/lib/gitlab/phabricator_import/importer.rb +++ b/lib/gitlab/phabricator_import/importer.rb @@ -18,7 +18,7 @@ module Gitlab end def execute - Gitlab::Import::SetAsyncJid.set_jid(project) + Gitlab::Import::SetAsyncJid.set_jid(project.import_state) schedule_first_tasks_page true |