summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcharlieablett <cablett@gitlab.com>2019-04-24 14:31:20 +1200
committercharlieablett <cablett@gitlab.com>2019-04-24 14:31:20 +1200
commit7e6befc05de87ba44115bbae0274c65727f9c2b9 (patch)
tree33465e8177975f59044c46f7d1ef3f6e8feacc8c /lib
parentb8c3e60ea23cd8c6f32ed438fd3c155add47a8e1 (diff)
downloadgitlab-ce-7e6befc05de87ba44115bbae0274c65727f9c2b9.tar.gz
Add disallowed fields to AttributeCleaner
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/import_export/attribute_cleaner.rb14
-rw-r--r--lib/gitlab/import_export/import_export.yml3
2 files changed, 13 insertions, 4 deletions
diff --git a/lib/gitlab/import_export/attribute_cleaner.rb b/lib/gitlab/import_export/attribute_cleaner.rb
index 93b37b7bc5f..1faa3c1614f 100644
--- a/lib/gitlab/import_export/attribute_cleaner.rb
+++ b/lib/gitlab/import_export/attribute_cleaner.rb
@@ -24,7 +24,19 @@ module Gitlab
private
def prohibited_key?(key)
- key.end_with?('_id') && !ALLOWED_REFERENCES.include?(key)
+ return false if allowed_reference?(key)
+
+ return true if 'cached_markdown_version'.equal?(key)
+
+ prohibited_suffices = %w(_id _html)
+ prohibited_suffices.each do |suffix|
+ return true if key.end_with?(suffix)
+ end
+ false
+ end
+
+ def allowed_reference?(key)
+ ALLOWED_REFERENCES.include?(key)
end
def excluded_key?(key)
diff --git a/lib/gitlab/import_export/import_export.yml b/lib/gitlab/import_export/import_export.yml
index ab0c9a32d42..ce268793128 100644
--- a/lib/gitlab/import_export/import_export.yml
+++ b/lib/gitlab/import_export/import_export.yml
@@ -141,9 +141,6 @@ excluded_attributes:
- :external_diff_size
issues:
- :milestone_id
- notes:
- - :note_html
- - :cached_markdown_version
merge_requests:
- :milestone_id
- :ref_fetched