Page MenuHomePhabricator

Allow two- and one-path interwiki linking for user names
Open, NormalPublic5 Story Points

Description

Task

  • Create a whitelist for 2-level interwiki linking that contains wikipedia.org
  • Create a whitelist for 1-level interwiki linking that contains mediawiki.org
  • User names should get the interwiki linking of the whitelist they are on. If they are on none of the whitelists, we fall back to the default ("imported>")

Note
FileRevisions cannot work with interwiki links, and will link to the Commons user pages

Event Timeline

Lea_WMDE created this task.Jun 12 2018, 9:56 AM
Restricted Application added a project: TCB-Team. · View Herald TranscriptJun 12 2018, 9:56 AM
Lea_WMDE triaged this task as Normal priority.Jun 12 2018, 9:57 AM
Lea_WMDE updated the task description. (Show Details)
Lea_WMDE set the point value for this task to 5.
Lea_WMDE moved this task from Backlog to Tickets in sprint on the Move-Files-To-Commons board.

Change 440857 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[mediawiki/extensions/FileImporter@master] Add a temp config to allow interwiki linking

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

Change 440860 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[operations/mediawiki-config@master] Add ar, de and fa wikipedia to FileImporter interwiki config

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

We collected three possible solutions:

  1. https://gerrit.wikimedia.org/r/440857 implements a simple "global wiki ID to interwiki prefix" map, e.g. "dewiki" => "w:de". This is meant to be temporary, because it repeats configuration from somewhere else, is limited to be used on Commons, and is not maintainable in the long run.
  2. We explored the idea to build 2-level interwiki prefixes from what we know about the wiki group (e.g. dewiki is in the Wikipedia group, and the one prefix we know from this group is w:) plus the language code, resulting in w:de:. Problem: There are to many exceptions. We would still need to repeat some configuration (at least the groups, as well as one or more blacklists of language codes), ending with the same problems with long-time maintainability.
  3. Use a proper interwiki lookup.
    • Resolving one level (e.g. mw:) is not hard.
    • When we need to resolve an other level, we can either use the interwikimap API, or direct access to the global interwiki configuration, if available.

Closer investigation:

  • I had a look at the dumpInterwiki.php script from the MediaWiki-extensions-WikimediaMaintenance. It's not helpful. It does read all information from text files, but never connects to a database.
  • The interwikimap API seems the way to go. This is especially relevant when we don't have direct access to other wikis databases.
  • The API uses MediaWikiServices::getInstance()->getInterwikiLookup() internally. We can access this directly in our setup.

The interwikimap API seems the way to go. This is especially relevant when we don't have direct access to other wikis databases.

When doing this I guess it would be really nice to implement that "reverse" lookup in core. It can be quite useful for other projects as well and shouldn't be to hard.

Change 440857 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Add a temp config to allow interwiki linking

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

Change 441009 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[mediawiki/extensions/FileImporter@wmf/1.32.0-wmf.8] Add a temp config to allow interwiki linking

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

Change 441061 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[mediawiki/extensions/FileImporter@master] Get prefixes from direct matches in the interwiki table

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

Just for the record here and especially for @Lea_WMDE : A first version of this is implemented with a configurable Whitelist that allows interwiki prefixes for the wikis we aim for at the moment. On the long run this should be replaced by an automated lookup.

Change 441061 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Get prefixes from direct matches in the interwiki table

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

Change 441197 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/FileImporter@master] Let InterwikiTablePrefixLookup reject ambiguous hosts

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

Change 441197 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Let InterwikiTablePrefixLookup reject ambiguous hosts

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

Change 441871 had a related patch set uploaded (by Addshore; owner: WMDE-Fisch):
[mediawiki/extensions/FileImporter@wmf/1.32.0-wmf.999] Add a temp config to allow interwiki linking

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

Change 440860 merged by jenkins-bot:
[operations/mediawiki-config@master] Add ar, de and fa wikipedia to FileImporter interwiki config

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

Stashbot added a subscriber: Stashbot.

Mentioned in SAL (#wikimedia-operations) [2018-06-25T14:19:15Z] <addshore@deploy1001> Synchronized wmf-config/CommonSettings.php: [[gerrit:440860|Add ar, de and fa wikipedia to FileImporter interwiki config]] T196969 T196976 (duration: 00m 56s)

Change 441009 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@wmf/1.32.0-wmf.8] Add a temp config to allow interwiki linking

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

Change 441871 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@wmf/1.32.0-wmf.999] Add a temp config to allow interwiki linking

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

Mentioned in SAL (#wikimedia-operations) [2018-06-25T14:30:59Z] <addshore@deploy1001> Synchronized php-1.32.0-wmf.999/extensions/FileImporter: [[gerrit:441871|Add a temp config to allow interwiki linking]] T196976 (duration: 00m 58s)

Mentioned in SAL (#wikimedia-operations) [2018-06-25T14:32:22Z] <addshore@deploy1001> Synchronized php-1.32.0-wmf.8/extensions/FileImporter: [[gerrit:441009|Add a temp config to allow interwiki linking]] T196976 (duration: 00m 57s)

Vvjjkkii renamed this task from Allow two- and one-path interwiki linking for user names to r7aaaaaaaa.Jul 1 2018, 1:04 AM
Vvjjkkii raised the priority of this task from Normal to High.
Vvjjkkii removed WMDE-Fisch as the assignee of this task.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed the point value for this task.
Vvjjkkii edited subscribers, added: WMDE-Fisch; removed: gerritbot.
CommunityTechBot set the point value for this task to 5.Jul 2 2018, 9:03 AM
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot assigned this task to WMDE-Fisch.
CommunityTechBot lowered the priority of this task from High to Normal.
CommunityTechBot renamed this task from r7aaaaaaaa to Allow two- and one-path interwiki linking for user names.
CommunityTechBot edited subscribers, added: gerritbot; removed: WMDE-Fisch.
WMDE-Fisch removed WMDE-Fisch as the assignee of this task.Aug 30 2018, 11:41 AM
WMDE-Fisch added a subscriber: WMDE-Fisch.