Create API to list entities that will be deleted when deleting a user
Manage:Workspace
Problem to solve
From this conversation: #364090 (comment 1086086211)
This is helpful for instance administrators to get an understanding of that user's reach and contributions in an instance before deleting that user. It gives them a sense of the impact of deleting that specific account.
An instance admin can run this endpoint to gather metrics around the contributions of each user in the instance to understand the impact of deleting that person.
Proposal
Introduce new API endpoint like GET /users/:id/entity_counts
(or, a better name) that exposes these counts using a new serializer.
API will be used in #364090 (closed) to display entities that will be deleted when deleting a user.
Availability and Testing
- No new E2E tests or updates needed at this time.
- Recommend adding a new request spec in addition to other unit and integration test updates.
- Consider testing the performance of this endpoint on a user with a very large amount of contributions across many groups and projects, similar to a real world scenario on GitLab.com.
Edited by Sarah Waldner