Bitbucket Server importer: map users by username rather than email address
Problem to solve
We have a customer who is attempting to import data from their Bitbucket server into GitLab. Because of firewall protections, they are unable to do the import from the server directly, so they have instead installed an intermediary Bitbucket server. They then exported the repo(s) from the production Bitbucket server and imported them into the intermediary Bitbucket server. When done in this way, only the repo data is imported. No user metadata is imported.
When attempting to import the repo from Bitbucket to GitLab we see the userid associated with activity in the Bitbucket repo, but when we attempt to get the email address of that user to map the user to GitLab we don't get any email address. This results in everything being assigned to the user doing the import, with a note of the original userid.
The customer is requesting that we have an option to map based on userid when doing the import to GitLab, rather than mapping by email address.
We have also encouraged them to look into what they can do to populate user metadata onto the Bitbucket server as an alternative "fix" for this problem.
Internal link to customer ZD ticket
Default to OFF
This feature is hidden behind the feature flag bitbucket_server_user_mapping_by_username
, since it is to be used only in exceptional cases, such as the one described above. The default behavior should be mapping by email address only.