Issue 1217: Allow Admins to update usernames
Status:  New
Owner: ----
Reported by vijayend...@gmail.com, Dec 20, 2011
Affected Version:

What steps will reproduce the problem?
1. Login to review.openstack.org. 
2. Click on Settings link on top right hand corner. Then click on Profile on left, and enter an id in the Username text field. Click outside of the box, saving the username.
3. Attempt to change the username after this by clicking on the box and typing into it and clicking outside of the box. It will never change it to what you type. There isn't another way to change it either.

I'm unable to get my openstack gerrit reviews to work because this username box has a value that is different from my launchpad.net id. They should be the same and I need to change it asap.

What is the expected output? What do you see instead?

I expected to be able to reset the username on review.openstack.org, or set it to another value. Neither is currently possible.

Please provide any additional information below.

N/A.

Please treat this as a high priority request. Thanks!


Dec 20, 2011
#1 vijayend...@gmail.com
Please note that I do not have a workaround for this. I couldn't find an option to bump up the bug's priority. It is important that I get this to work asap, else I can't figure out how to checkin code to openstack git trees using gerrit (git review). The fix is probably not very complicated, so it would be great if this could be prioritized.
Dec 27, 2011
Project Member #2 bklarson@gmail.com
Changing this to a feature request and removing the openstack reference in the summary.  This isn't currently possible, if it is urgent your best bet it to talk with the openstack admin and have them update the database.
Summary: Cannot change Username in Profile Settings
Labels: -Type-Bug Type-Feature
Dec 27, 2011
#3 vijayend...@gmail.com
The problem is that the username I've added to gerrit is already assigned to a different developer in launchpad. So enabling gerrit to change a wrongly entered username is sorely required. I will speak to the openstack admin and see what can be done. Thanks.
Dec 27, 2011
Project Member #4 edwin.ke...@gmail.com
Please note that earlier versions of Gerrit did allow to change the username, however this functionality was removed by intention. It was removed by change 15829 [1] (commit c25b07b89c5009f0818f9558a4784165627e14dd). In the commit message the motivation for this change is explained like this:
"The username can only be set once per account now, and once set is
not permitted to be changed. This change simplifies our UI, but it
also sets the stage for supporting ${user} variables in access rules
for references, and renaming an account once it has branches owned by
it would complicate the account rename process."

So the reason that it is not allowed to change the username is the support for ${user} variables in the access rules for references that was introduced by change 15844 [2] (commit f14ada51fab53367a31870d22b86bcd3b23e772f). With that users can have own (sandbox) branches that contain the username in the branch name. If the username is changed it would mean that all git repositories have to be scanned for such user branches, that then need to get renamed as well.

[1] https://gerrit-review.googlesource.com/15829
[2] https://gerrit-review.googlesource.com/15844
Dec 28, 2011
Project Member #5 bklarson@gmail.com
Thanks Edwin! I should have dug into this a bit more.  I think the logic for that decision is very sound.

There are still times where a user might have a typo, etc in their user name.  I wonder if long-term we should allow administrators to update user names in the web UI for these cases?  If you agree I'll update the summary of this issue.
Dec 28, 2011
Project Member #6 edwin.ke...@gmail.com
Yes, I think it's a good idea to allow at least Gerrit administrators to update single user names. Not sure if this needs to be available in the web UI, maybe an SSH command would be sufficiant. If it would be an SSH command then the documentation page of this command would be also a good place to explain potential consequences of changing the user name. Of course allowing it from the web UI would be nice too.
Dec 28, 2011
Project Member #7 bklarson@gmail.com
I agree, an ssh command might be better especially for the short-term.
Summary: Allow Admins to update usernames
Oct 12, 2013
#9 schub...@ckurs.de
I think there is a way to change the username.
1. Allow admins to access the database
 https://gerrit.wikimedia.org/r/Documentation/access-control.html#capability_accessDatabase
2. change the username
 https://gerrit.wikimedia.org/r/Documentation/cmd-gsql.html
update account_external_ids set external_id='username:new_user' where external_id='username:old_user'
May 12, 2014
#10 scio...@gmail.com
So I've accidentally placed myself in this state as well, where my Gerrit username does not match my Launchpad ID.

What's the current way to fix this?

Also, could there be a warning and confirmation step before setting the ID, please? If there had been a label or a dialog to warn me that this must match Launchpad, I wouldn't have made the mistake in the first place.

May 12, 2014
#11 dborowitz@google.com
The current way to fix this is to ask your local server admin at Wikimedia. They are also the ones responsible for the constraint that it much match your Launchpad ID; Gerrit itself doesn't care what your username is. They should also document this if they haven't already; I don't think we necessarily want to change core Gerrit to allow pluggable warning text. (Though instead of plugging it they could of course patch Gerrit themselves.)

+1 for documenting in the Gerrit UI that the username can't be changed without admin intervention, however.