Page MenuHomePhabricator

[Gerrit] Contribution is not visible based on email
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

Goto the https://gerrit.wikimedia.org/r/q/owner:0freerunning%2540gmail.com

What happens?:
It shows that I have no contribution and "No changes" text.

What should have happened instead?:
Show show contributions like https://gerrit.wikimedia.org/r/q/owner:%22Jayprakash12345%22 and https://gerrit.wikimedia.org/r/q/author:0freerunning@gmail.com

Other information (browser name/version, screenshots, etc.):
It used to work for me. The last time, I added the same link on my Meta page, was back in 2018. See https://meta.wikimedia.org/w/index.php?title=User:Jayprakash12345&diff=next&oldid=17735634. Since then, I have been using this link. This is the first time that it is showing "No changes".

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I think the "owner" tag only applies to the gerrit account and primary e-mail, whereas the "author" one shows up associated e-mails. But I could be wrong.

Aklapper renamed this task from [Gerrit] Contribution is not visiable based on email to [Gerrit] Contribution is not visible based on email.Dec 11 2024, 8:28 PM

Discussion in #wikimedia-sre:

[19:26:05] <Jayprakash12345>	 Hi SRE team,
[19:26:05] <Jayprakash12345>	 it seems like the contribution is not visible on Gerrit. See https://gerrit.wikimedia.org/r/q/owner:0freerunning@gmail.com. I have 500+ patches.
[19:33:10] <cdanis>	 Jayprakash12345: I see "1-25 of many" ... do you perhaps have Javascript disabled?
[19:35:10] <Reedy>	 Or logged out?
[19:35:38] <Reedy>	 I see none actually
[19:38:05] <Jayprakash12345>	 cdanis: It is showing "No changes" on different browser with logged-in and log out state. See https://paste.pics/2f61da323f2871a6c506c3dbd8dca1a0
[19:38:59] <swfrench-wmf>	 owner:"Jayprakash12345" seems to consistently work as expected as long as it does not autocomplete to email
[19:39:15] <cdanis>	 it is consistent for me
[19:39:20] <Reedy>	 There's 3 seemingly different accounts showing with that email
[19:39:28] <Reedy>	 if you put a space after that in the search bar
[19:40:27] <AntiComposite>	 author:<email> shows 1-25 of many, but I also see nothing for owner:<email>
[19:43:37] <Jayprakash12345>	 https://gerrit.wikimedia.org/r/q/owner:%22Jayprakash12345%22 and https://gerrit.wikimedia.org/r/q/author:0freerunning@gmail.com is working for me. Thanks cdanis and AntiComposite. This is strange because I used to share https://gerrit.wikimedia.org/r/q/owner:0freerunning@gmail.com to others. It was working well from last couple of years.
[19:45:18] <AntiComposite>	 Jayprakash12345, if it worked before and doesn't now, you should file a phab task and tag Gerrit
[19:55:34] <Jayprakash12345>	 Done https://phabricator.wikimedia.org/T382028
[19:57:54] <mutante>	 Jayprakash12345: I see a bunch of changes when I click that link
[19:58:11] <cdanis>	 mutante: yes, it's inconsistent between users, interestingly
[19:58:18] <cdanis>	 I also consistently saw a bunch of changes
[19:58:43] <mutante>	 I only see them when I am logged in. not when logged out. that's odd. ok
[20:00:30] <swfrench-wmf>	 this is likely a side-effect of what Reedy also noted above, that there appear to be three different gerrit accounts associated with that address (leading to some kind nondeterminism as to which you end up seeing when searching by email)
[20:01:28] <mutante>	 yes, agreeed. 3 different accounts on one email. I think Tyler will be able to dig into this further.
[20:01:46] <mutante>	 good that a ticket was created, thanks
[20:02:24] <mutante>	 Jayprakash12345: try this:  https://gerrit.wikimedia.org/r/q/author:0freerunning@gmail.com
[20:02:30] <mutante>	 author vs owner
[20:02:35] <mutante>	 per comment from James. wfm
[20:03:09] <Jayprakash12345>	 Just a note that the other two accounts were also from 2018.
[20:03:42] <mutante>	 one thing that changed since 2018 is that gerrit does not use a mysql db anymore and instead all users and things like that are in git itself
[20:04:40] <mutante>	 renaming users is hard
[20:07:15] <mutante>	 Jayprakash12345: see a new comment on the ticket. I'm sure there will be more soon-ish, just some patience please because some key people are currently away
[20:09:04] <Jayprakash12345>	 mutante: No problem. It is not a critical or high-priority thing. If it easy to fix then do. Otherwise, I have change the links from lot of places.
[20:09:30] <Jayprakash12345>	 I have to*
[20:09:33] <mutante>	 Jayprakash12345: ok, sounds good:) until then, maybe consider using the author: URL

If I do https://gerrit.wikimedia.org/r/q/owner:0freerunning%2540gmail.com that currently works for me. The problem is Gerrit has three different accounts associated to that email address:

LDAPAccount id in Gerrit
jayprakash123454864
j lodhi6691
jayprakash5579

Gerrit requires the email address to be unique but our system to create an account does not enforce that condition (see T270233 , the issue is in Bitu our homemade identity management system).

The link uses the owner search predicate (documentation) which takes as parameter a user also named an account. The given user is subject to a fuzzy search which was more or less the topic of the private bug T307558, see how searching for an account can has some heuristic to search against user/email/account id etc https://gerrit.wikimedia.org/r/Documentation/rest-api-accounts.html#account-id . But in this case my guess is Gerrit is sometime lost and associate the email with one of the two users which have no changes. The faulty accounts should probably be disabled.

Mentioned in SAL (#wikimedia-releng) [2024-12-17T17:27:17Z] <hashar> gerrit set-account 5579 --inactive # T382028

Mentioned in SAL (#wikimedia-releng) [2024-12-17T17:27:24Z] <hashar> gerrit set-account 6691 --inactive # T382028

hashar claimed this task.

I have disabled the two most recent accounts which will prevent Gerrit from associating 0freerunning@gmail.com to them:

j lodhi6691
jayprakash5579

That can be verified in the top right search box by inputing owner:0freerunning which now show a single entry. The corresponding API request is:

$ curl 'https://gerrit.wikimedia.org/r/accounts/?o=DETAILS&q="0freerunning"&n=10'
)]}'
[{"_account_id":4864,"name":"Jayprakash12345","email":"0freerunning@gmail.com","username":"jayprakash12345"}]

Which is what I have should have used to demo multiple accounts were returned.

So I believe that is fixed, and the root cause is our identity management not enforcing uniqueness of email when registering an account ( T270233 ).

@Jayprakash12345 please reopen this task if that is still a problem!