Page MenuHomePhabricator

Convert WikibaseRepository, WikibaseClient, WikibaseLib and WikibaseView to use extension registration
Closed, ResolvedPublic

Description

As a wikibase developer I want wikibase to use extensions registration so that I can make easy use of new mediawiki features such as PSR4 autoloading T182943.
As a WMDE employee I want wikibase to use the same extension registration system as other WMDE maintained extensions so that I only need to know about 1 system.
As the WMF I want wikibase to use extension registration so that all extensions are consistent T87875

Details

More details are available on T87875.
Also see the docs on https://www.mediawiki.org/wiki/Manual:Extension_registration

All 4 extension entry points in the Wikibase git repo need to be converted.
That is:

Impact & priority

Per T87875#5579302 Wikibase is one of the final 3 extension groups to be converted that are deployed to the WMF cluster.
This many not be actively blocking anything critical, but this ticket has been open since 2015 and moving forward with it will require commitment by the Wikibase teams due to the complexity of the entry points and configuration.

Task

Convert all listed entry points to use extension registration.

Acceptance criteria

  • Wikibase can still be loaded using the .php entry points using backwards compatible stubs
  • All entry points listed above (4) are converted

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Addshore removed the point value for this task.Jul 2 2018, 5:27 PM
Addshore added a subscriber: Addshore.

Removing the story point as I can't see when it was actually added and I don't believe it is comparable to our current story points

Addshore renamed this task from [Task] Convert WikibaseClient, WikibaseLib and WikibaseRepository to use extension registration to Convert WikibaseClient, WikibaseLib and WikibaseRepository to use extension registration.Jul 31 2018, 11:46 AM
Addshore removed WMDE-leszek as the assignee of this task.
Addshore added a subscriber: WMDE-leszek.
Addshore updated the task description. (Show Details)
Addshore moved this task from Unsorted to Migrate / Replace on the Technical-Debt board.
Addshore added a project: Story.
Addshore moved this task from Research to Goals on the wdwb-tech board.

Another potentially related task semi-blocked on this one: T188717

Lucas_Werkmeister_WMDE renamed this task from Convert WikibaseClient, WikibaseLib and WikibaseRepository to use extension registration to Convert WikibaseRepository, WikibaseClient, WikibaseLib and WikibaseView to use extension registration.Apr 16 2019, 11:26 AM
Lucas_Werkmeister_WMDE updated the task description. (Show Details)

T87985: Convert Translate to use extension registration has an interesting proposal for how to do the migration: instead of trying to convert the whole file at once, which results in a huge patch that’s hard to review and grows stale quickly, start with an empty extension-wip.json file, load that from the PHP entrypoint, and then start moving parts of the extension registration from PHP to JSON one by one, until the PHP file is just the wfLoadExtension() call and extension-wip.json can be renamed to a proper extension.json. It looks like that approach was pretty successful for the Translate extension, so I think we should follow it here as well.

That sounds like a great idea :)

Removing this form the campsite, until it has gone through the exploration we are currently doing

Addshore moved this task from Incoming to Needs Work on the Wikidata-Campsite board.

Needs a breakdown for each thing we are going to move.
Will do this soon.

T87985: Convert Translate to use extension registration has an interesting proposal for how to do the migration: instead of trying to convert the whole file at once, which results in a huge patch that’s hard to review and grows stale quickly, start with an empty extension-wip.json file...

+1, this approach was relatively painless for the Translate extension, and has been validated by successful, incremental deployment.

Change 535546 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] PSR-4 autoload more of Wikibase Client

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

Change 535546 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] PSR-4 autoload more of Wikibase Client

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

Wikibase is now the last remaining WMF deployed extension that needs to switch over :)

Change 551613 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Move two jobs to extension registration

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

Change 551900 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Move repo hooks to extension registration

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

Change 551613 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Move two jobs to extension registration

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

Change 551900 abandoned by Lucas Werkmeister (WMDE):
Move repo hooks to extension registration

Reason:
not pursued in this form, instead we should migrate the hooks more individually

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

I just wanted to say we are this (🤏) close to finishing this. Client is already there and repo will follow suit in a week or two. We are waiting for deployments of the changes so we can change them in extension-list.

Thank you so much for moving forward on this task :]

Thank you so much for moving forward on this task :]

Oh it's mostly work of @Lucas_Werkmeister_WMDE @ItamarWMDE and @Tarrow. I mostly hit shiny +2 buttons.

Change 399437 abandoned by Ladsgroup:
[mediawiki/extensions/Wikibase@master] [WIP] Switch to load extension using MediaWiki's extension registration

Reason:
This is done already through many many patches.

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

Mentioned in SAL (#wikimedia-operations) [2020-07-23T18:29:21Z] <ladsgroup@deploy1001> Synchronized wmf-config/Wikibase.php: [[gerrit:613235|Load WikibaseClient from extension.json file instead of php one (T257437 T256228 T88258)]] (duration: 01m 05s)

Thank you so much for moving forward on this task :]

Feel free to follow the progress here

Ladsgroup moved this task from ready to go to in progress on the Wikidata board.

This is done, you can now load Wikibase extensions using extension.json, the mediawiki.org documentation has been updated but we will write announcements soon and won't break php entry point for now.

For repo:

wfLoadExtension( 'WikibaseRepository', "$IP/extensions/Wikibase/extension-repo.json" );
require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";
$wgWBRepoSettings['siteLinkGroups'] = [ 'mywikigroup' ];
$wgLocalDatabases = [ 'enwiki', 'fawiki' ];
$wgWBRepoSettings['localClientDatabases'] = array(
    'en' => 'enwiki',
    'fa' => 'fawiki'
);

For client:

wfLoadExtension( 'WikibaseClient', "$IP/extensions/Wikibase/extension-client.json" );
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";
$wgWBClientSettings['repoUrl'] = 'https://pool.my.wiki';
...

Shout out to @Lucas_Werkmeister_WMDE @Tarrow @ItamarWMDE for their great work.

Thank you @darthmon_wmde for the link to Wikibase Extension Decoupling and Registration :] To everyone involved:

antoine-approve

comment best seen via the web interface