GitHub import doesn't associate user even user sign in using GitHub icon

Update from 11.11.2022

It doesn't matter whether the user was logged in using the GitHub icon or signed up using GitLab registration form. The way how we are searching users to associate with MR/Issue is the same. It depends on the user's GitHub settings, the public email on GitHub account should be present in both cases.

The fix is to update the documentation and make this requirement explicit.

Summary

When importing project from GitHub, import documentation mentioned:

For this association to succeed, each GitHub author and assignee in the repository must meet one of the following conditions prior to the import:

- Have previously logged in to a GitLab account using the GitHub icon.
- Have a GitHub account with a publicly visible primary email address on their profile that matches their GitLab account’s primary or secondary email address.

However, it seems logging in to a GitLab account using the GitHub icon doesn't make a successful association.

Steps to reproduce

  1. Have a project on GitHub
  2. User B create a Pull request on GitHub
  3. User B sign into GitLab.com using the GitHub icon
  4. User A import the project from GitHub
  5. See the MR created by User B is now created by user A

Example Project

Example case:

https://gitlab.zendesk.com/agent/tickets/184405

https://gitlab.zendesk.com/agent/tickets/186052

What is the current bug behavior?

Importing project from GitHub doesn't associate user correctly even the user previously log in to GitLab with GitHub icon.

What is the expected correct behavior?

The user association succeed as mentioned in the document.

Relevant logs and/or screenshots

Output of checks

This bug happens on GitLab.com; GitLab Enterprise Edition 13.8.0-pre 7c725fd4

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited by Magdalena Frankiewicz