Misattributed commit

Bug #1172944 reported by Stefano Maffulli
20
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Community Project
Fix Released
High
Sanjiva Nath

Bug Description

on
http://activity.openstack.org/data/display/OPNSTK2/New+Contributors+Latest+Activity+-+Last+30+Days

Justin Dossey Apr 10, 2013

    [Commit] - Make sure custom grep options don't get in the way

https://github.com/openstack-dev/devstack/commit/4e971118ff410407ead7b577cc31bf7341555746

https://review.openstack.org/#/c/26647/ Change I3c8fa217: Make sure custom grep options don't get in the way

jasondunsmore is the author and owner of the patch, while the report attributes it to Justin Dossey. Since there is no Justin Dossey among the members of the OpenStack Foundation I believe the attribution is a mistake.

Tags: wikidsmart
Revision history for this message
Stefano Maffulli (smaffulli) wrote :

Probably similar issue:

This coommit:
https://github.com/openstack/python-novaclient/commit/23ee4b818d800d08abf123a65c69213c0eff0900

is attributed to

Christopher Griffiths Mar 27, 2013 [Commit] - setuptools: remove data_files section

but it should be Christoph Gysin, as visible on https://review.openstack.org/#/c/25560/

Revision history for this message
Jean Huertas Lopez (jphuertas) wrote :

The problem is that the username of the uploader in gerrit is "jbd" with name "Jason Dunsmore" and the launchpad user "jbd" is not jasondunsmore but Justin Dossey (https://launchpad.net/~jbd). So looks that in the cases mentioned the username in gerrit does not correspond to username in launchpad.
Here it is the output from gerrit API from that change:
-----
[sshexec] cmd : gerrit query --format=JSON --all-approvals I3c8fa21793906d80790c31ed02f585eff35a64a5
  [sshexec] {"project":"openstack-dev/devstack","branch":"master","topic":"grep_options_bug","id":"I3c8fa21793906d80790c31ed02f585eff35a64a5","number":"26647","subject":"Make sure custo
m grep options don\u0027t get in the way","owner":{"name":"Jason Dunsmore","email":"<email address hidden>","username":"jbd"},"url":"https://review.openstack.org/26647","createdOn
":1365619683,"lastUpdated":1366141530,"sortKey":"002472e100006817","open":false,"status":"MERGED","patchSets":[{"number":"1","revision":"4e971118ff410407ead7b577cc31bf7341555746","ref":
"refs/changes/47/26647/1","uploader":{"name":"Jason Dunsmore","email":"<email address hidden>","username":"jbd"},"createdOn":1365619683,"approvals":[{"type":"SUBM","value":"1","gr
antedOn":1366141530,"by":{"name":"Jenkins","username":"jenkins"}},{"type":"VRIF","description":"Verified","value":"2","grantedOn":1366141530,"by":{"name":"Jenkins","username":"jenkins"}
},{"type":"APRV","description":"Approved","value":"1","grantedOn":1366138563,"by":{"name":"Dean Troyer","email":
  [sshexec] "<email address hidden>","username":"dtroyer"}},{"type":"CRVW","description":"Code Review","value":"2","grantedOn":1366138563,"by":{"name":"Dean Troyer","email":"<email address hidden>
m","username":"dtroyer"}},{"type":"CRVW","description":"Code Review","value":"2","grantedOn":1365620116,"by":{"name":"Sean Dague","email":"<email address hidden>","username":"sdague"}}]}]}
  [sshexec] {"type":"stats","rowCount":1,"runTimeMilliseconds":3}
-----

The same issue applies to the change mentioned in the comment https://review.openstack.org/#/c/25560 the username for uploader is: "username":"chris" and https://launchpad.net/~chris is Christopher Griffiths

Revision history for this message
Jeremy Stanley (fungi) wrote :

To properly map a Gerrit account to the corresponding Launchpad account, we piggyback on the only real existing relationship between them: authentication data. Here is an example of how we go about it in our infrastructure...

    https://github.com/openstack-infra/jeepyb/blob/master/jeepyb/cmd/update_bug.py

    query = """SELECT t.external_id FROM account_external_ids t
               INNER JOIN (
               SELECT t.account_id FROM account_external_ids t
               WHERE t.email_address = %s )
               original ON t.account_id = original.account_id
               AND t.external_id LIKE 'https://login.launchpad.net%%'"""
    cursor = jeepyb.gerritdb.connect().cursor()
    cursor.execute(query, searchkey)
    data = cursor.fetchone()
    if data:
        assignee = launchpad.people.getByOpenIDIdentifier(identifier=data[0])

In short, look up the OpenID URL associated with the Gerrit account, then query the Launchpad API for the user belonging to that URL. The example above used direct MySQL queries to Gerrit's backend database, but something similar could almost certainly be accomplished via grsql queries through Gerrit's SSH API interface instead if sufficient privileges are already in place. Alternatively, I could set up a data dump containing this mapping on demand, given some advance warning.

Changed in openstack-community:
importance: Undecided → High
Revision history for this message
Jean Huertas Lopez (jphuertas) wrote :

I tried to access the GSQL ssh command to execute the SQL query in openstack gerrit, but the problem is that it seems to need admin access.

ssh -p 29418 -l zagile review.openstack.org gerrit gsql
fatal: Not a Gerrit administrator

Is there another way to get the launchpad login names without requiring admin privileges? Otherwise we would need admin privileges for zagile user to be able to try this query in gsql.

Revision history for this message
Stefano Maffulli (smaffulli) wrote :

JP, I have talked with the infra team and elevating the privileges is not an option. We need to think to a workaround.

One way I suggest is to try to match the email address of the author in the commit to the Launchpad email: if the user has no email exposed in Launchpad then ignore that association. Since in the past months Launchpad has decreased its importance as source of authentication data I think we can have people (committers) with no Launchpad account associated. We'll probably loose bug reports from some of them though. Maybe we can have a way to 'manually' add that relation somewhere?

Would this work?

Changed in openstack-community:
status: New → Confirmed
Revision history for this message
Jean Huertas Lopez (jphuertas) wrote :

Before we were matching users by nickname so, jbd in gerrit could be a different user jbd in launchpad.
We are currently matching gerrit user email to launchpad users email, so I think most of similar missattributed stuffs should be fixed.

Changed in openstack-community:
status: Confirmed → Fix Committed
Changed in openstack-community:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.