-
Type:
Suggestion
-
Resolution: Unresolved
-
None
-
Component/s: User Management, Crowd & LDAP integration
-
0
-
4
Summary
Currently, user deletion is blocked if the user created build result labels, comments or favourite plan.
When the build is expired, or deleted, the user labels, comment or favourited plan records remain in the respective tables. This blocks the possibility to delete such user.
Suggestion
Add possibility to view records of a user based with respective build results, and ability to perform multiple actions.
Workaround
Manually remove the labels and comment of the users.
To do this, first run the following SQL to find any Build key and Build number where the user has added comments or label.
SELECT BS.build_key, BS.build_number FROM LABEL L JOIN buildresultsummary_label BL ON BL.label_id = L.label_id JOIN buildresultsummary BS ON BS.buildresultsummary_id = BL.buildresultsummary_id WHERE BL.user_name IN ('USERNAME')
SELECT BS.build_key, BS.build_number FROM user_comment uc JOIN buildresultsummary_label BL ON BL.buildresultsummary_id =uc.entity_id JOIN buildresultsummary BS ON BS.buildresultsummary_id = BL.buildresultsummary_id WHERE uc.user_name IN ('USERNAME')
when you get the result, you can substitute the values in the UI to get the location of such.
http://localhost:8085/browse/PLAN_KEY-BUILD_NUMBER
if the results returned from the label table contains a name row called :favourite
this is a favourite plan, and can unfavourite plan.
If the query don't produce information but the user is not deletable, the build result or build is likely deleted or expired. You should search the user_name record in each buildresultsummary_label and user_comment table i.e;
SELECT * FROM user_comment uc WHERE uc.user_name ='USERNAME'
SELECT * FROM LABEL L WHERE L.namespace='USERNAME'
and update the username with random string. e.g deleted_user
UPDATE label SET namespace='DELETED_USER' WHERE namespace='USERNAME';
UPDATE user_comment SET user_name='deletec_user' WHERE user_name='username';