Skip to content

Bitbucket Server import: Search for approvers by email and username

Madelein van Niekerk requested to merge 23586-use-email-for-approvals into master

What does this MR do and why?

During Bitbucket Server import, we try to match approvals from Bitbucket with users on Gitlab so that we can create the same approvals. This is currently only finding users matching by username but we can also match by email since it is returned by the API and increases the chances of finding a user.

How to set up and validate locally

  1. Setup bitbucket server (not trivial but the steps can be found here) and create a pull request.
  2. Create another user, invite the user to the project, sign in as that user and approve the PR.
  3. In your rails console, create a user with the same email as the approver on Bitbucket Server (but not the same username).
  4. Import the project into gitlab and note that the approval is correctly imported.

image

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #23586 (closed)

Edited by Madelein van Niekerk

Merge request reports