Assign all imported contributions to personal namespace owner

What does this MR do and why?

When importing to a personal namespace, all contributions were assigned to the Import User. Now all contributions are assigned to the owner of the personal namespace.

  • Cleanup user_mapping_to_personal_namespace_owner related code
  • Remove all code related to user_mapping_to_personal_namespace_owner FF
  • Update documentation.

References

#569780 (closed)

Screenshots or screen recordings

Before After

How to set up and validate locally

This change impacts the importers for GitHub, Gitea, and Bitbucket Server. We need to test these importers, and the following aspects should be verified:

When importing projects into personal namespace

  1. UI warning should display the following message

    When you import to a personal namespace, all contributions are assigned to the personal namespace owner and they cannot be reassigned. To map contributions to real users, import to a group instead. Learn more.

  2. All imported contributions should be assigned to the personal namespace owner
  3. No placeholder references or import source user should be created.

When importing projects into a group

  1. No UI warning should be displayed
  2. All imported contributions should be assigned to placeholder users
  3. Placeholder references and the import source user should be created.

GitHub Importer

  1. Create a project on GitHub.com with some contributions (MR, issues, comments)
  2. In GitLab:
    1. If not already enabled, turn on the GitHub Importer in the admin settings under Admin -> Settings -> General -> Import and export settings -> Import sources -> GitHub.
    2. Visit /projects/new#import_project
    3. Choose GitHub.
    4. Provide a GitHub access token
    5. Select a project to be imported
    6. Import the project into a personal namespace and then into a group
    7. Verify if the importer works as expected

Gitea Importer

  1. Create a project on Gitea.com with some contributions (MR, issues, comments)
  2. In GitLab:
    1. If not already enabled, turn on the Gitea Importer in the admin settings under Admin -> Settings -> General -> Import and export settings -> Import sources -> Gitea.
    2. Visit /projects/new#import_project
    3. Choose Gitea.
    4. Gitea host URL (https://gitea.com)
    5. Provide a Gitea access token
    6. Select a project to be imported
    7. Import the project into a personal namespace and then into a group
    8. Verify if the importer works as expected

Bitbucket Server Importer

  1. Follow the Import and Integration guide to set up a local Bitbucket Server instance.
  2. In the Bitbucket Server instance, create a repo and a PR with comments.
  3. In GitLab:
    1. If not already enabled, turn on the Bitbucket Server Importer in the admin settings under Admin -> Settings -> General -> Import and export settings -> Import sources -> Bitbucket Server.
    2. Visit /admin/application_settings/network and enable local requests.
    3. Visit /projects/new#import_project.
    4. Choose Bitbucket Server.
    5. Enter your server details, and click List your Bitbucket Server repositories.
    6. Import the project into a personal namespace and then into a group
    7. Verify if the importer works as expected

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Rodrigo Tomonari

Merge request reports

Loading