Page MenuHomePhabricator

Cross-wiki imports should set correct rev_user, not 0
Closed, ResolvedPublic

Description

Looking at my global contributions shows that edits by me have been imported into a number of different wikis. For example, this one on wikimania2016. However, as you can see from Special:Contributions/Scott, these edits are not attached to my global account.

The import tool needs to be rewritten so this stops happening (and possibly disabled entirely until it has been), and a cleanup process run to identify and reattach the edits.

Related Objects

Event Timeline

Scott raised the priority of this task from to Medium.
Scott updated the task description. (Show Details)
Scott subscribed.
TTO subscribed.

Blah! If only I wasn't so busy I'd look at this within the next few days :(

@Legoktm do you have any input on the SUL side of things?

Do imported revisions have rev_user = 0 as expected or not?

See T9240 and the related bugs.

Thanks Lego, I thought this would have been reported in some fashion already. From 2007 :(

I'm happy for this bug to be merged in there and that one updated to reflect that it's now working against SUL finalization, as I wrote above.

Nemo_bis claimed this task.
Nemo_bis added a subscriber: aaron.

rev_user = 0 as expected, hence import is behaving correctly and this report is invalid with this summary.

MariaDB [wikimania2016wiki_p]> select rev_user_text, rev_user from revision join page on rev_page = page_id and page_title = 'Done' and rev_user_text = 'Scott';
+---------------+----------+
| rev_user_text | rev_user |
+---------------+----------+
| Scott         |        0 |
| Scott         |        0 |
| Scott         |        0 |
+---------------+----------+
3 rows in set (0.02 sec)

Special:Contributions recently stopped showing such contributions, but that's an unintended consequence of @aaron's 99984c809 which should probably reverted.

No, I think import should be changed to be SUL-finalization-savvy. I consider T9240 to be a general, non-CentralAuth-specific bug relating to imports between arbitrary wikis (e.g. from enwiki to your own test wiki).

TTO renamed this task from Cross-wiki imports create edits unattached to global accounts to Cross-wiki imports should attribute edits from global accounts to the global account, rather than user ID 0.Sep 12 2015, 9:30 AM
TTO removed Nemo_bis as the assignee of this task.
TTO set Security to None.

rev_user = 0 as expected, hence import is behaving correctly and this report is invalid with this summary.
...
Special:Contributions recently stopped showing such contributions, but that's an unintended consequence of @aaron's 99984c809 which should probably reverted.

I see. Yes, that should absolutely be corrected. Thanks to global user pages I have a virtual presence on any wiki that has imported my edits (example for the above), but you can't get to those edits from it.

[Edit: Changed "reverted" to "corrected" as I don't know what the rest of the change did.]

Suggested solution: Automatically create and attach a local account if an account exists globally when importing pages. This would also have the side-effect that the user's global userpage is displayed on the local wiki, which I suppose is useful.

Scott renamed this task from Cross-wiki imports should attribute edits from global accounts to the global account, rather than user ID 0 to Cross-wiki imports should set correct rev_user, not 0.Mar 3 2016, 7:07 PM
Scott updated the task description. (Show Details)

Change 386625 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] Avoid DB rows with usable names but ID = 0 by introducing "interwiki" usernames

https://gerrit.wikimedia.org/r/386625

Change 386626 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/extensions/CentralAuth@master] Update for core interwiki user handling change

https://gerrit.wikimedia.org/r/386626

Change 386626 merged by jenkins-bot:
[mediawiki/extensions/CentralAuth@master] Update for core interwiki user handling change

https://gerrit.wikimedia.org/r/386626

Change 386625 merged by jenkins-bot:
[mediawiki/core@master] Avoid DB rows with usable names but ID = 0 by introducing "interwiki" usernames

https://gerrit.wikimedia.org/r/386625

Anomie claimed this task.
Anomie subscribed.

New cross-wiki imports will either set a correct rev_user or attribute the edit to an "interwiki" username that cannot be confused with a local name.

Running a cleanup script will be tracked in T181731.

Tagging @Graham87 since he does a lot of import stuff, so this is probably something he'd like to know.

Tagging @Graham87 since he does a lot of import stuff, so this is probably something he'd like to know.

Thanks, it all sounds good to me. I've added my two cents in a couple of other related places.