Skip to content

Deprecate Ghost User

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to solve

Currently it is possible for admins to permanently delete users without deleting their associated records (issues, MRs, comments, etc). This is accomplished by irreversibly moving their associated records to the ownership of a shared "Ghost User". This "ghostification" creates some problems:

  1. Compliance. The process of ghostification effectively deletes the record of who did what. It is still clear what happened, but not who did it. This is a major problem for compliance programs like SOX.
  2. Complexity. The process of ghostification is complex. Moving all of one user's associated records to another user is like picking up a house and moving it to a new foundation. Yes, it can be done. But it is requires lots of time, effort, and special equipment, and even with your best efforts the house might have problems afterward. The complexity of ghostification has prompted lots of bugfixes and feature requests that would not be necessary with a simpler solution (see the list below). In particular, there is currently a proposal to create a unique Ghost User for every deleted user, which would partially improve the compliance problem, but at the cost of worsening complexity.

Proposal

It should not be possible to delete a user without deleting the user's associated records. We should deprecate Ghost User, although it must continue existing where it is already in use, because we have no way to roll back.

To be more specific, a user should continue to be deletable by an administrator, however:

  • Users should NEVER be deleted without deleting all associated records. (This means we should stop using the Ghost User, although we should allow it to continue existing where it is already in use, because we have no way to unwind it.)
  • Users should NOT be able to delete themselves if they have group/project contributions, because those contributions have become "community property". (Question: How can we allow for conscientious deletions?)
  • Administrators SHOULD be able to delete users (including all associated records) if they have group/project contributions. (This is already possible with the hard_delete argument.) This is for handling bad actors like spammers. Administrators should be strongly warned: "This will DELETE absolutely everything the user has ever done, including comments, commit pushes, etc."

Related links

Some of the bugs related to "ghost user"

(One small example is hard delete of user results in nil author,

Impact on importers

If this is implemented, it should be communicated to Import group, as importers are mapping ghost users contributions from source to ghost users on destination instance. See Direct Transfer - Contributions of ghost user s... (#514014 - closed).

Edited by 🤖 GitLab Bot 🤖