summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-06-10 21:34:21 +0700
committerShinya Maeda <shinya@gitlab.com>2019-06-10 22:53:20 +0700
commitab0a7c8ecc1ed56097066a7aa10561e04bad6dc9 (patch)
treee76e49122779e4d0113f4de845c467128c9f512c
parenta0af34582cf0f3c5d901dfe9c78d9ef05c900d7f (diff)
downloadgitlab-ce-ignore-artifact-attirbutes-in-project-import-export.tar.gz
Ignore legacy artifact columns in Project Import/Exportignore-artifact-attirbutes-in-project-import-export
Ignore some columns
-rw-r--r--lib/gitlab/import_export/import_export.yml3
-rw-r--r--lib/gitlab/import_export/project_tree_restorer.rb3
-rw-r--r--spec/lib/gitlab/import_export/project.json3
3 files changed, 8 insertions, 1 deletions
diff --git a/lib/gitlab/import_export/import_export.yml b/lib/gitlab/import_export/import_export.yml
index 7bbcb53f016..71c44af9254 100644
--- a/lib/gitlab/import_export/import_export.yml
+++ b/lib/gitlab/import_export/import_export.yml
@@ -156,6 +156,9 @@ excluded_attributes:
- :when
- :artifacts_file
- :artifacts_metadata
+ - :artifacts_file_store
+ - :artifacts_metadata_store
+ - :artifacts_size
- :commands
push_event_payload:
- :event_id
diff --git a/lib/gitlab/import_export/project_tree_restorer.rb b/lib/gitlab/import_export/project_tree_restorer.rb
index 20caadb89c0..09dff8cd15a 100644
--- a/lib/gitlab/import_export/project_tree_restorer.rb
+++ b/lib/gitlab/import_export/project_tree_restorer.rb
@@ -34,6 +34,7 @@ module Gitlab
end
end
rescue => e
+ binding.pry
@shared.error(e)
false
end
@@ -59,6 +60,7 @@ module Gitlab
# Finally, it updates each attribute in the newly imported project.
def create_relations
default_relation_list.each do |relation|
+ puts "#{self.class.name} - #{__callee__}: relation: #{relation}"
if relation.is_a?(Hash)
create_sub_relations(relation, @tree_hash)
elsif @tree_hash[relation.to_s].present?
@@ -163,6 +165,7 @@ module Gitlab
# But we can't have it in the upper level or GC won't get rid of the AR objects
# after we save the batch.
Project.transaction do
+ puts "#{self.class.name} - #{__callee__}: relation: #{relation} relation_item: #{relation_item}"
process_sub_relation(relation, relation_item)
# For every subrelation that hangs from Project, save the associated records altogether
diff --git a/spec/lib/gitlab/import_export/project.json b/spec/lib/gitlab/import_export/project.json
index fb7bddb386c..ebacdbfed8d 100644
--- a/spec/lib/gitlab/import_export/project.json
+++ b/spec/lib/gitlab/import_export/project.json
@@ -6223,7 +6223,8 @@
"erased_by_id": null,
"erased_at": null,
"type": "Ci::Build",
- "token": "abcd"
+ "token": "abcd",
+ "artifacts_size": 10
},
{
"id": 72,