From eeb13c16d1f627eba10313bf5c4662416392feb3 Mon Sep 17 00:00:00 2001
From: James Lopez <james@jameslopez.es>
Date: Wed, 25 Jan 2017 10:17:50 +0100
Subject: [PATCH] rename method and added note to export file spec about new
 encrypted attributes

---
 lib/gitlab/import_export/relation_factory.rb             | 4 ++--
 spec/features/projects/import_export/export_file_spec.rb | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/gitlab/import_export/relation_factory.rb b/lib/gitlab/import_export/relation_factory.rb
index 8a44e78fb44..cb9f20a70a0 100644
--- a/lib/gitlab/import_export/relation_factory.rb
+++ b/lib/gitlab/import_export/relation_factory.rb
@@ -62,7 +62,7 @@ module Gitlab
         update_project_references
 
         handle_group_label if group_label?
-        reset_ci_tokens!
+        reset_tokens!
 
         @relation_hash['data'].deep_symbolize_keys! if @relation_name == :events && @relation_hash['data']
         set_st_diffs if @relation_name == :merge_request_diff
@@ -142,7 +142,7 @@ module Gitlab
         end
       end
 
-      def reset_ci_tokens!
+      def reset_tokens!
         return unless Gitlab::ImportExport.reset_tokens? && TOKEN_RESET_MODELS.include?(@relation_name.to_s)
 
         # If we import/export a project to the same instance, tokens will have to be reset.
diff --git a/spec/features/projects/import_export/export_file_spec.rb b/spec/features/projects/import_export/export_file_spec.rb
index 52d08982c7a..2fbfe045b7f 100644
--- a/spec/features/projects/import_export/export_file_spec.rb
+++ b/spec/features/projects/import_export/export_file_spec.rb
@@ -74,6 +74,9 @@ feature 'Import/Export - project export integration test', feature: true, js: tr
         Otherwise, please add the exception to +safe_list+ in CURRENT_SPEC using #{sensitive_word} as the key and the
         correspondent hash or model as the value.
 
+        Also, if the attribute is encrypted, please add it to either the list of excluded attributes in IMPORT_EXPORT_CONFIG
+        or the model to RelationFactory::TOKEN_RESET_MODELS if it includes a token that can be reset.
+
         IMPORT_EXPORT_CONFIG: #{Gitlab::ImportExport.config_file}
         CURRENT_SPEC: #{__FILE__}
       MSG
-- 
GitLab