summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Brandl <abrandl@gitlab.com>2018-07-31 16:13:32 +0200
committerAndreas Brandl <abrandl@gitlab.com>2018-08-16 10:01:02 +0200
commitb78a69b06c165f7a463d5e0de69030346d9d5c72 (patch)
tree46fcdcde0ec1977dd3765ca7e6d745857c868263 /lib
parenta2d647b1137821ef87fc177ac85ac775f2ce55c1 (diff)
downloadgitlab-ce-b78a69b06c165f7a463d5e0de69030346d9d5c72.tar.gz
Trigger iid logic from GitHub importer for issues.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/github_import/importer/issue_importer.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/github_import/importer/issue_importer.rb b/lib/gitlab/github_import/importer/issue_importer.rb
index 31fefebf787..ead4215810f 100644
--- a/lib/gitlab/github_import/importer/issue_importer.rb
+++ b/lib/gitlab/github_import/importer/issue_importer.rb
@@ -55,7 +55,11 @@ module Gitlab
updated_at: issue.updated_at
}
- GithubImport.insert_and_return_id(attributes, project.issues)
+ GithubImport.insert_and_return_id(attributes, project.issues).tap do |id|
+ # We use .insert_and_return_id which effectively disables all callbacks.
+ # Trigger iid logic here to make sure we track internal id values consistently.
+ project.issues.find(id).ensure_project_iid!
+ end
rescue ActiveRecord::InvalidForeignKey
# It's possible the project has been deleted since scheduling this
# job. In this case we'll just skip creating the issue.