Skip to content

Move MentionsConverter to Import namespace

Carla Drago requested to merge 436320-map-by-username into master

What does this MR do and why?

This is the first step in mapping GitHub PR mentions by username on import. Moving these BitbucketServer classes into a generic namespace means they can be used by other importers more cleanly.

I thought it best to do these changes first, to ensure nothing with the BitBucket Server import fails.

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.

How to set up and validate locally

  1. Disable the feature flag
    Feature.disable(:bitbucket_server_convert_mentions_to_users)
  2. Setup bitbucket server by following these instructions
  3. Create another user at http://localhost:7990/admin/users with email john@gmail.com and username doe. Add any (read/write/admin) permission for this user to access the project.
  4. Create a project and repo, push up changes and create a pull request. Mention @doe in the pull request description and create a note with a mention.
  5. On gdk, create a user with email janedoe@gmail.com and username doe
  6. Import the project from bitbucket server
  7. Go to the MR and see that the note/description has an @mention linking to Jane's profile
  8. Enable the feature flag
    Feature.enable(:bitbucket_server_convert_mentions_to_users)
  9. Delete the project (so that we can import again)
    Projects::DestroyService.new(Project.last, User.first, {}).execute
  10. Import the project again and see that the MR now does not have an @mention for Jane.
  11. Optionally repeat the process with:
    1. On gitlab, update Jane's email to john@gmail.com -> link to Jane's profile
    2. On BBS, remove John's access to the project -> does not have a link to a user profile
    3. On gitlab, delete Jane's user -> does not have a link to a user profile

Related to #436320 (closed)

Edited by Carla Drago

Merge request reports