Skip to content

User mapping - Importer User

For the improved user contribution mapping, contributions will be assigned to placeholder users, a particular type of user with limited access that resembles the user in the source instance.

However, a namespace can create a limited number of placeholder users, and if the limit is reached, contributions will be assigned to a common user called "Importer User".

On this issue, we should define a new user_type called importer_user and create a class to create it. The class should be placed in the Import namespace.

Only one Importer User should be created per top-level namespace;

Question

Can we use the field user_details#provisioned_by_group to associate the user with the namespace? This field is used by other features such as Service accounts and ]Enterprise users for a similar purpose.

Proposal

From #443553 (comment 1928037703):

Add a new internal user type to HasUserType::USER_TYPES called import_user. This user type will not be a bot.

Apply the same extra restrictions as we do with placeholder users #443552 (closed).

Implement logic that creates or returns one of these new import users for a top-level namespace (Group#root_ancestor). Look at Users::Internal which is responsible for returning or creating other kinds of internal users that are scoped to one per instance. If the scope of our logic (one per namespace) could work with that existing code, it would be ideal to place our logic in that class. Otherwise, implement it somewhere in Importers namespace.

Edited by Luke Duncalfe