Page MenuHomePhabricator

Wikibase defaults should be usable out of the box
Open, MediumPublic

Description

For a long time Wikibase has been a bit of a "special" extension, as it really contains 2 other extensions (or 3 or more at times) and none of these extensions follow the standard practices for extensions.
Namely

  1. Be loadable via wfLoadExtension( 'EXTENSIONNAME' )
  2. Have default configuration that works out of the box

This ends up being confusing for anyone that works on or around or uses Wikibase, and results in overheads for standard systems such as Wikimedia extension CI which needs special cases for Wikibase, and an confusing entry point at Wikibase.php link

Currently the documented way for loading Wikibase is:

wfLoadExtension( 'WikibaseRepository', "$IP/extensions/Wikibase/extension-repo.json" );
require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";
wfLoadExtension( 'WikibaseClient', "$IP/extensions/Wikibase/extension-client.json" );
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";

This task has goals of:

  • Provide a default experience that would be loaded with wfLoadExtension( 'Wikibase' ), likely with both repo and client loaded
  • Continue to allow the individual extensions to be loaded in their current way, maintaining back compatibility.
  • Load sensible defaults for Wikibase in all of these situations. (Probably the things in the relevant ExampleSettings files)

Acceptance Criteria: 🏕️🌟(September 2021)

  • Users of Wikibase can load the extension (Repo & Client) using a single call to wfLoadExtension( 'Wikibase' )
  • Existing extension entry points can still be used and do not change behaviour

OLD 2015 ticket description

Copy some of the reasonable assumptions from repo/config/Wikibase.example.php to repo/config/Wikibase.default.php, and also for the client settings. For example, $wgWBRepoSettings["entityNamespaces"] should default to the registered WB_NS_ITEM namespace and so on...

Fix any code that will not run without customized configuration.

Also, as suggested in the TODO at the end of Wikibase.php, the default mode should be to require both the repo and client entry points. It's not nice that the traditional incantation throws a fatal "Incomplete configuration" error,

require_once "$IP/extensions/Wikibase/Wikibase.php";

Event Timeline

awight raised the priority of this task from to Needs Triage.
awight updated the task description. (Show Details)
awight added a project: Wikidata.
Lydia_Pintscher set Security to None.
Jonas renamed this task from Wikibase defaults should be usable out of the box to [Task] Wikibase defaults should be usable out of the box.Nov 2 2015, 3:52 PM
Jonas added a project: Technical-Debt.

Discussed in story time, we will likely split this into 2 tasks

  1. Get rid of requiring the example settings files
  2. Investigate (and then estimate implementing) just needing 1 wfLoadExtension call

Hm, getting rid of the example settings files isn’t going to be as simple as I thought. Most of the example settings can be either moved into the default settings (entitySources) or removed (ssrServerUrl). But for client, those files also define new namespaces, and as far as I know there’s no way in MediaWiki to conditionally define namespaces in extension.json. (WikiLambda eventually hard-coded the use of the main namespace, I believe.)

Can you programmatically add namespaces from an extension callback hook?

Addshore renamed this task from [Task] Wikibase defaults should be usable out of the box to Wikibase defaults should be usable out of the box.Sep 23 2021, 10:12 AM

The first part (just thinking about settings files) as been split into T291617