Skip to content

Use dummy email address for Ghost Gitea users

Carla Drago requested to merge 389559-handle-ghost-users into master

What does this MR do and why?

This change updates the legacy github importer (used to import Gitea projects) to assign a dummy email address for 'Ghost' (i.e. deleted) Gitea users. This enables the import process to skip requesting the Gitea api /user endpoint for the email address of the 'Ghost' user, and avoid the consequent 404 not-found error.

Screenshots or screen recordings

Gitea Pull Request

Created by the Ghost user and including a comment by the Ghost user:

Imported Merge Request

The importing user, @carlad-gl is now assigned authorship:

Gitea Issue

Created by the importing user @carlad-gl. Includes a comment by the Ghost user:

Imported Issue

The comment by the Ghost user has authorship assigned to the importing user, @carlad-gl:

How to set up and validate locally

  1. Create two users at https://gitea.com. Make sure one of the users uses the same email address as a gdk.test user with an email address you have access to.
  2. Create a repository in Gitea. Ensure both new Gitea users are collaborators on the repository.
  3. Create a pull request and an issue for the repo in Gitea. Leave comments on both the pull request and issue signed in as both users.
  4. Create a personal access token in Gitea for the User that will execute the import in gdk.test. Make sure they have read scopes (though to be sure I just gave my token full access 😄)
  5. Delete the other user in gitea
  6. In gdk.test log in as root then via the admin user panel go to the user with the same email address as the non-deleted Gitea user and impersonate them.
  7. Create a new project by selecting Import Project.
  8. click on the Gitea button and enter the url and personal access token.
  9. import the gitea repository you created
  10. observe the imported project has created MR and issue comments and assigned those of the Ghost user to the importing user.

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 #389559 (closed)

Edited by Carla Drago

Merge request reports