Commit attributions can be incorrect when users email addresses are changed

Bug #404315 reported by Space Hobo
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

https://code.launchpad.net/~spacehobo/yardbird/trunk is a branch that was maintained elsewhere before the yardbird project or this account was created. I pushed it up, and found all my commits attributed to the wrong account.

Part of this is obviously caused by changes to both accounts, but it would appear that a bad association between my e-mail address or name and the other account has been cached rather agressively. I'm told that any commits I now push to launchpad will be attributed to that other account, and all karma will remain there.

I asked mwhudson about this in IRC, and he suggested that it was almost certainly a bug.

Tags: karma lp-code
Jonathan Lange (jml)
tags: added: karma
Changed in launchpad-code:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

We talked about this a little and seemed to come to the conclusion that we need to listen to events for emails been associated and disassociated from accounts, and update revisionauthor linkages as appropriate.

(This would also remove the need for the cronscript that links unlinked revisionauthors that we have at the moment)

Revision history for this message
Tim Penhey (thumper) wrote : Re: [Bug 404315] Re: Commits attributed to the wrong user

On Mon, 27 Jul 2009 12:13:55 Michael Hudson wrote:
> We talked about this a little and seemed to come to the conclusion that
> we need to listen to events for emails been associated and disassociated
> from accounts, and update revisionauthor linkages as appropriate.
>
> (This would also remove the need for the cronscript that links unlinked
> revisionauthors that we have at the moment)

We used to have it that emails would be linked to revision authors at the time
they got added, but this code was moved into a cron script for some reason. I
don't know all the details.

Revision history for this message
Stuart Bishop (stub) wrote :

On Mon, Jul 27, 2009 at 12:29 PM, Tim Penhey<email address hidden> wrote:
> On Mon, 27 Jul 2009 12:13:55 Michael Hudson wrote:
>> We talked about this a little and seemed to come to the conclusion that
>> we need to listen to events for emails been associated and disassociated
>> from accounts, and update revisionauthor linkages as appropriate.
>>
>> (This would also remove the need for the cronscript that links unlinked
>> revisionauthors that we have at the moment)
>
> We used to have it that emails would be linked to revision authors at the time
> they got added, but this code was moved into a cron script for some reason.  I
> don't know all the details.

Email addresses can be maintained on login.launchpad.net, which we
need to remain operational when the rest of Launchpad is down for
maintenance. So we had to stop doing the linking at that time.

The RevisionAuthorEmailLinker in canonica/launchpad/scripts/garbo.py
needs to be updated to relink RevisionAuthor records pointing to an
incorrect Person.

UPDATE RevisionAuthor
SET person = EmailAddress.person
FROM EmailAddress
WHERE lower(RevisionAuthor.email) = lower(EmailAddress.email)
    AND EmailAddress.person <> RevisionAuthor.person

--
Stuart Bishop <email address hidden>
http://www.stuartbishop.net/

Revision history for this message
Stuart Bishop (stub) wrote : Re: Commits attributed to the wrong user

I've fixed the data for nick manually. The bug still remains - if an email address is reassigned to a different person, existing revisionauthor records are not updated.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

> Email addresses can be maintained on login.launchpad.net, which we
> need to remain operational when the rest of Launchpad is down for
> maintenance. So we had to stop doing the linking at that time.

I guess this would be a nice use case for a messaging bus, but for now I guess there's not much we can do.

Revision history for this message
Robert Collins (lifeless) wrote :

Rabbit!

Also, perhaps we shouldn't link to the author, we should link to the email address itself? I suspect we don't have a 'activeemail' table (vs one that has historic cruft in it) though.

Changed in launchpad:
importance: Medium → Low
summary: - Commits attributed to the wrong user
+ Commits attributions are not updated / migrated when users email
+ addresses are changed
summary: - Commits attributions are not updated / migrated when users email
- addresses are changed
+ Commit attributions can be incorrect when users email addresses are
+ changed
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

Related questions

Remote bug watches

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