diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 09:08:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 09:08:42 +0000 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /lib/gitlab/github_import/user_finder.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) | |
download | gitlab-ce-b76ae638462ab0f673e5915986070518dd3f9ad3.tar.gz |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'lib/gitlab/github_import/user_finder.rb')
-rw-r--r-- | lib/gitlab/github_import/user_finder.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/gitlab/github_import/user_finder.rb b/lib/gitlab/github_import/user_finder.rb index 058cd1ebd57..f583ef39d13 100644 --- a/lib/gitlab/github_import/user_finder.rb +++ b/lib/gitlab/github_import/user_finder.rb @@ -120,10 +120,18 @@ module Gitlab read_id_from_cache(ID_FOR_EMAIL_CACHE_KEY % email) end - # Queries and caches the GitLab user ID for a GitHub user ID, if one was - # found. + # If importing from github.com, queries and caches the GitLab user ID for + # a GitHub user ID, if one was found. + # + # When importing from Github Enterprise, do not query user by Github ID + # since we only have users' Github ID from github.com. def id_for_github_id(id) - gitlab_id = query_id_for_github_id(id) || nil + gitlab_id = + if project.github_enterprise_import? + nil + else + query_id_for_github_id(id) + end Gitlab::Cache::Import::Caching.write(ID_CACHE_KEY % id, gitlab_id) end |