Page MenuHomePhabricator

Request rename of "waldir" to "waldyrious" on LDAP
Closed, ResolvedPublic

Description

I'd like my username on LDAP (Wikitech, Gerrit, Toolforge) to be rename from "Waldir" to "waldyrious" (lowercase if possible). This is following the renaming of my account on Wikimedia wikis, per T225370.

Links

Happy to provide any additional information that may be needed. Thanks in advance!

Event Timeline

waldyrious renamed this task from Request rename of "waldir" to "waldyrious" on LDAP (wikite to Request rename of "waldir" to "waldyrious" on LDAP.Jul 8 2019, 10:13 PM
akosiaris triaged this task as Medium priority.Jul 15 2019, 2:26 PM
akosiaris subscribed.

@waldyrious

The account has been renamed on wikitech per https://wikitech.wikimedia.org/w/index.php?title=User:Waldyrious&action=history. LDAP has been updated as well.

There's a few actions left however on your behalf

Gerrit

  • Go to https://gerrit.wikimedia.org/r/#/settings/contact and click on "Reload". You will be asked to login again, use your new Wikitech username
  • You should be able to see your history, make sure you see your new username as "Owner".
  • Git pull some random repo using ssh, it should work

Phabricator

To update your phabricator account linking

  • Go to your profile and click on Manage->Edit Settings->External Accounts
  • Unlink the Wikitech auth and relink it with your new wikitech username.

Notes

Horizon should work already, however note that your homedir on WMCS VMs can't be renamed.

akosiaris claimed this task.

I am resolving this, feel free to reopen is something is amiss

@akosiaris, I seem to be having trouble following those instructions. I can't log in on Wikitech nor on Gerrit. Please see the screenshots attached below:

Screenshot from 2019-07-16 00-22-17.png (579×520 px, 64 KB)

Screenshot from 2019-07-16 00-23-52.png (629×513 px, 123 KB)

I'm using the same password as I had before the rename.

I am resolving this, feel free to reopen is something is amiss

The cn and sn for uid=waldir,ou=people,dc=wikimedia,dc=org are both waldyrious (lower case w). Wikitech will never be able to authenticate as MediaWiki will canonicalize the username to start with a capital letter W and wikitech is configured to enforce same case matching for user account lookup.

^ Worth to document this somewhere™ (or in more places) to avoid repeating?

I am resolving this, feel free to reopen is something is amiss

The cn and sn for uid=waldir,ou=people,dc=wikimedia,dc=org are both waldyrious (lower case w). Wikitech will never be able to authenticate as MediaWiki will canonicalize the username to start with a capital letter W and wikitech is configured to enforce same case matching for user account lookup.

Changed to Waldyrious (upper case) per comment above. @waldyrious could you please try again logging into wikitech?

@thcipriani The gerrit error seems to be the same as T216605, mind running that script?

^ Worth to document this somewhere™ (or in more places) to avoid repeating?

I am inclined to make it more like "renaming is not really possible and should not be tried in general"

I 've added a note in https://wikitech.wikimedia.org/wiki/LDAP/Renaming_users, https://wikitech.wikimedia.org/w/index.php?title=LDAP/Renaming_users&diff=1832853&oldid=1801956

I am resolving this, feel free to reopen is something is amiss

The cn and sn for uid=waldir,ou=people,dc=wikimedia,dc=org are both waldyrious (lower case w). Wikitech will never be able to authenticate as MediaWiki will canonicalize the username to start with a capital letter W and wikitech is configured to enforce same case matching for user account lookup.

Changed to Waldyrious (upper case) per comment above. @waldyrious could you please try again logging into wikitech?

@thcipriani The gerrit error seems to be the same as T216605, mind running that script?

In this instance it's not the case of the username, gerrit requires a manual rename in this instance. For reference, I wrote a different script to handle this:

gerrit-rename-account-sh
#!/bin/bash

set -euo pipefail

OLD_USERNAME="$1"
NEW_USERNAME="$2"

OLD_SHASUM=$(printf "gerrit:%s" "${OLD_USERNAME}" | shasum -a 1)
NEW_SHASUM=$(printf "gerrit:%s" "${NEW_USERNAME}" | shasum -a 1)

OLD_FILE=$(printf '%s/%s\n' "${OLD_SHASUM:0:2}" "${OLD_SHASUM:2:38}")
NEW_FILE=$(printf '%s/%s\n' "${NEW_SHASUM:0:2}" "${NEW_SHASUM:2:38}")

git mv "$OLD_FILE" "$NEW_FILE"

# Change username to lowercase in new file
sed -i "s/gerrit:${OLD_USERNAME}/gerrit:${NEW_USERNAME}/" "$NEW_FILE"

Account should be updated in gerrit -- @waldyrious try logging in now.

I've managed to log in to Wikitech now.

I've also updated my Phabricator account by unlinking the "Waldir" LDAP account and adding the "Waldyrious" one.

On Gerrit, I could log in, and did click on "Reload" in https://gerrit.wikimedia.org/r/#/settings/contact, but it didn't seem to make any change: my Gerrit username still appears to be "Waldir", and that's also the name that shows up in the changesets I am the owner of. Attaching screenshots below:

Screenshot_2019-07-21 Settings gerrit wikimedia Code Review.png (342×418 px, 48 KB)

Screenshot_2019-07-21 Settings gerrit wikimedia Code Review(1).png (345×778 px, 57 KB)

Maybe I messed up some of the steps?

Your gerrit username (the one that is depicted in the username line on F29825695, can not change. That's something that is in gerrit, there is nothing we can do about that (aside from creating a new account, and even then deleting an account is not safe). What can change is the Full name (which is what is used in most screens/dashboards), which should happen when clicking that reload button, after which you should be kicked out of gerrit and forced to login again.

Got you. Still, I've done that multiple times now (click "Reload", get asked to login again, and login with the new credentials), yet the Full name still shows "Waldir" as shown in the screenshot above.

Got you. Still, I've done that multiple times now (click "Reload", get asked to login again, and login with the new credentials), yet the Full name still shows "Waldir" as shown in the screenshot above.

hrm. I can't manually update the fullname using gerrit set-account --full-name since we have it set to the cn in ldap. I guess that means I need to update the full name directly in the database since there seems to be no way to trigger a re-sync with ldap.

I can't manually update the fullname using gerrit set-account --full-name since we have it set to the cn in ldap.

Just to clear things up a bit: do you mean the old value of cn for my LDAP account? I'm asking because

The cn and sn for uid=waldir,ou=people,dc=wikimedia,dc=org are both waldyrious (lower case w).

@thcipriani any update on this? seems stalled or partially resolved.

This should be complete now.

For reference I updated the user ref in All-Users:

git fetch origin refs/users/[user-id]
git config -f account.config account.fullName [new username]
git add account.config
git commit -m 'thcipriani: modify user fullname'
git push origin HEAD:refs/users/[user-id]

I then reindexed all user accounts:

ssh -p 29418 gerrit.wikimedia.org -- gerrit index start accounts --force

waldyrious-rename.png (195×749 px, 25 KB)