Page MenuHomePhabricator

Remove WB_NO_CONFIGURE_EXAMPLE_REPO constant / hack
Closed, ResolvedPublic

Description

WB_NO_CONFIGURE_EXAMPLE_REPO is a constant defined in repo/Wikibase.php (the WikibaseRepo PHP entry point) with one single purpose: to inform client/config/WikibaseClient.example.php that it should not configure an example repo for this client, as it does by default. It was added in Ie42d0218c2, replacing the earlier use of WB_VERSION for the same purpose (a constant that we wanted to remove for T256238), as part of the move of WikibaseClient to JSON-based extension registration without a PHP entry point.

Since we eventually want to load WikibaseRepo without a PHP entry point as well, we have to get rid of this new constant as well somehow.

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

I think the best solution to this is to just remove the whole example repo from WikibaseClient.example.php – or, more likely, to wrap it in if ( false ) instead of if ( !defined( 'WB_NO_CONFIGURE_EXAMPLE_REPO' ) ), just like the already existing block for a $wgLBFactoryConf which is also disabled with if ( false ).

Whether this affects any end users depends on how the example files are typically used, I suppose. The configured example repo isn’t very useful as a whole: the repo URL is http://repo.example.org. But it’s possible that people are loading the example settings and then only overriding the repo URL while keeping, say, the repo article path and script path.

But I think that should be tractable with an announcement to the wikidata-tech mailing list, informing users that if they have a client wiki that’s not also a repo, they may need to update their configuration. (I assume most wikibase clients are also repos – wikibase-docker, in particular, only supports this mode as far as I’m aware.)

(Wikimedia production should be unaffected anyways, as we don’t use the example settings at all there.)

I think the best solution to this is to just remove the whole example repo from WikibaseClient.example.php – or, more likely, to wrap it in if ( false ) instead of if ( !defined( 'WB_NO_CONFIGURE_EXAMPLE_REPO' ) ), just like the already existing block for a $wgLBFactoryConf which is also disabled with if ( false ).

Whether this affects any end users depends on how the example files are typically used, I suppose. The configured example repo isn’t very useful as a whole: the repo URL is http://repo.example.org. But it’s possible that people are loading the example settings and then only overriding the repo URL while keeping, say, the repo article path and script path.

But I think that should be tractable with an announcement to the wikidata-tech mailing list, informing users that if they have a client wiki that’s not also a repo, they may need to update their configuration. (I assume most wikibase clients are also repos – wikibase-docker, in particular, only supports this mode as far as I’m aware.)

(Wikimedia production should be unaffected anyways, as we don’t use the example settings at all there.)

Maybe a decision for @Samantha_Alipio_WMDE ?

@Samantha_Alipio_WMDE said in the daily today that she's happy for us to go with the suggestion from @Lucas_Werkmeister_WMDE

Change 614795 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Don’t configure example repo in client example config

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

Change 614795 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Don’t configure example repo in client example config

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