Bug 71162 - Cant add Gerrituser as a reviewer
Summary: Cant add Gerrituser as a reviewer
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: WWW (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-02 13:59 UTC by Björn Michaelsen
Modified: 2013-11-13 11:53 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
load_merge.sql (1.26 KB, text/plain)
2013-11-13 11:49 UTC, Björn Michaelsen
Details
merge_accounts.sql (5.04 KB, text/plain)
2013-11-13 11:52 UTC, Björn Michaelsen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Michaelsen 2013-11-02 13:59:02 UTC
I would love to add "Eilidh McAdam <eilidh.mcadam@gmail.com>" as a reviewer, but am cruelly denied with an "application error".
Comment 1 Björn Michaelsen 2013-11-02 14:01:34 UTC
(also the account shows up twice in the autocomplete popup.)
Comment 2 Björn Michaelsen 2013-11-02 14:50:19 UTC
Looks like its solved now. Would be great to have this "linking accounts" stuff documented somewhere easy to find though (Yes, I _should_ know how this works, but I fail hard on the 'easy to find' part.)
Comment 3 DavidO 2013-11-04 07:35:21 UTC
This  a known issue in Gerrit, which is tracked under the issue:

 https://code.google.com/p/gerrit/issues/detail?id=567

Moreover there is a script on Gerrit Wiki to handle the user merge:

 https://code.google.com/p/gerrit/wiki/SqlMergeUserAccounts

Unfortunately there is currently no way to do it from the UI and messing around with the underlying Gerrit database is necessary.
Comment 4 Björn Michaelsen 2013-11-13 11:49:12 UTC
Created attachment 89135 [details]
load_merge.sql

Thanks David.

Dumping the current script here as 'our' backup copy. Here is the blurb that comes with it:
"Sometimes users wind up with two accounts on a Gerrit server, this is especially common with OpenID installations when the user forgets which OpenID provider he had used, and opens yet another account with a different OpenID identity... but the site administrator knows they are the same person.

Unfortunately this has happened often enough on review.source.android.com that I've developed a set of PostgreSQL scripts to handle merging the accounts.

The first script, load_merge.sql, creates a temporary table called "links" which contains a mapping of source account_id to destination account_id. This mapping tries to map the most recently created account for a user to the oldest account for the same user, by comparing email addresses and registration dates. Administrators can (and probably should) edit this temporary table before running the second script. The second script, merge_accounts.sql, performs the merge by updating all records in the database in a transaction, but does not commit it at the end. This allows the administrator to double check any records by query before committing the merge result for good."
Comment 5 Björn Michaelsen 2013-11-13 11:51:22 UTC
Removing Eilidh from CC, specific problem is solved, just docing the general case.
Comment 6 Björn Michaelsen 2013-11-13 11:52:12 UTC
Created attachment 89136 [details]
merge_accounts.sql

attaching second script as local backup.