Updated - Added completion notification for project imports
What does this MR do and why?
This MR is an updated version of Added completion notification for project imports (!173596 - merged), which has been reverted. However, this MR excludes project mirrors, project forks, and any project import type that is not listed in ImportSources, the source of truth for where projects can be imported from. That way, repeat imports do not spam users with emails.
This MR adds an email to notify users that a for project import has completed, similar to the notification sent out when a Direct Transfer finishes. With the addition of user contribution mapping, no real users exist in an imported project until a group owner reassigns. We want to notify group owners when the import completes so that they can begin that process, and also to be consistent with Direct Transfer.
When user mapping is enabled on an import
- The importing user is notified. If they are also a root group owner who can reassign placeholder users, the email includes a message that they can begin reassigning users with a link to the group members placeholders tab. If not, they are told to inform a group owner that user reassignment can be done and are given a link to view import results (import history).
- Other group owners are also notified that the importing user's import has finished, with a link to begin reassigning users.
When user mapping is not enabled, has not been implemented, or the project is imported to a user namespace
- Only the importing user is notified and given a link to view import results (import history). There is no mention of user reassignment.
- Even if user mapping is enabled on an import, if the project was imported to a user namespace, it does not mention user reassignment because there's no group users page to reassign the single import user.
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
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
Set up the context to import a project into:
- Import into a group vs a user namespace?
- User mapping enabled, disabled, or use an importer that hasn't had user mapping enabled yet?
- Is the importing user a root group owner or only maintainer rights to import a project?
- Import a 3rd party project.
- Verify the completion email was sent according to the importing context.
- Verify that emails are not sent for project mirrors or other features that use importers, but are not one-time project imports.
Note: There's an issue with the Gitea importer that disables the user mapping imports, even if the feature flags are enabled: #506782 (closed)
If you just want to see the various combinations of email layouts, you can pull this branch and generate mailer previews.
Related to #503953 (closed)