BB Server importer: Lookup by username only if ops flag is enabled
What does this MR do and why?
This MR changes some parts of the BitBucket Server importer to:
- Look up a GitLab user by username ONLY when the
bitbucket_server_user_mapping_by_username
ops
flag is enabled. - Otherwise look up GitLab user by email address
This same flag checking logic is used elsewhere to determine if we should look up by username instead of email, but it was missed in some places.
The flag is disabled on GitLab.com so we should always look up by email and never by username on GitLab.com. Due to the number of users on GitLab, looking up by username frequently means we look up the "wrong" user and leads to confusing import results https://gitlab.com/gitlab-com/dev-sub-department/section-dev-request-for-help/-/issues/249.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.