Page MenuHomePhabricator

WikibaseRepo and WikibaseClient should not require loading default or example settings files
Closed, ResolvedPublic5 Estimated Story Points

Description

Split from T97012 in storytime. See that task for more details

Acceptance Criteria: 🏕️🌟(September 2021)

  • Users loading either WikibaseRepo or WikibaseClient do not need to also require default / example settings files

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 723615 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[mediawiki/extensions/Wikibase@master] Remove useless code comments and unreachable statements in examples

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

Change 723616 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[mediawiki/extensions/Wikibase@master] client: Remove default configs in the example file

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

Change 723615 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Remove useless code comments and unreachable statements in examples

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

Change 723616 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] client: Remove default configs in the example file

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

Unfortunately I won't be able to work on it more.

Change 726873 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Remove example config for termbox

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

Change 726917 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Remove shared cache key config from repo example config

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

Change 726920 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Remove extremely outdated comment from repo example config

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

With the changes uploaded so far, all the things remaining in Wikibase.example.php are related to namespaces (define the namespaces, declare them, register them as entity sources, and mark them to be searched by default). We don’t want to do that unconditionally in the default settings, but we can probably introduce a setting like defaultEntityNamespaces, and try setting up the namespaces in an extension callback. (We should watch out that we don’t run into T288819: NamespaceInfo service missing namespaces if initialized too early.)

Change 727366 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Move namespace registration out of example settings (mostly)

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

Change 726917 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Remove shared cache key config from repo example config

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

Change 726920 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Remove extremely outdated comment from repo example config

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

Change 727366 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Move namespace registration out of example settings (mostly)

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

Change 759742 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Allow totally missing $wgWBClientSettings

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

Lucas_Werkmeister_WMDE changed the task status from Stalled to Open.EditedFeb 4 2022, 5:29 PM

This is no longer blocked on T292962.

The client example settings are already done, and the repo example settings only have two things left:

  • define namespace constants for Item and Property namespaces (WB_NS_ITEM etc.)
  • tell Wikibase to register these namespaces (set defaultEntityNamespaces to true)

I think the next steps would be:

  • set defaultEntityNamespaces explicitly to false in our production config
  • let defaultEntityNamespaces default to true
    • with a release notes entry warning other wiki operators that they might want to set defaultEntityNamespaces to false in their config
  • remove defaultEntityNamespaces from the example settings

Once that’s done, it should be possible to use WikibaseRepo without the example config. We would still keep the example settings with the constants, for cases where people use those constants in their LocalSettings.php right after loading the example settings; but if you don’t use the example config, then Wikibase will define those namespaces later, and you’re good to go as long as you don’t use the constants in your LocalSettings.php. (If you want to use the constants, e.g. for namespace protections or whatever, then either define them yourself to whatever namespace number you want, or continue using the example settings.)

Edit: this basically just restates the commit message of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/727366 btw ^^

Change 759742 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Allow totally missing $wgWBClientSettings

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

@Lucas_Werkmeister_WMDE is this one still on your plate and being worked on?
I saw it pop into my backlog on Wikibase Suite Team and not sure if I should actually look at it at all? Or rather something to be left on the Wikidata-Campsite / Wikidata-Campsite (Team A Hearth 🏰🔥) ?

I guess I should unassign myself because I’m not working on it at the moment, no. Should be okay for someone else to pick up using the information in T291617#7683730 – I feel like, based on the product need, it belongs more in Team B than Team A?

Change 933880 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[operations/mediawiki-config@master] Set $wgWBRepoSettings['defaultEntityNamespaces'] to false

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

Change 933880 merged by jenkins-bot:

[operations/mediawiki-config@master] Set $wgWBRepoSettings['defaultEntityNamespaces'] to false

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

Mentioned in SAL (#wikimedia-operations) [2023-06-28T13:16:23Z] <reedy@deploy1002> Started scap: Backport for [[gerrit:933880|Set $wgWBRepoSettings['defaultEntityNamespaces'] to false (T291617)]]

Mentioned in SAL (#wikimedia-operations) [2023-06-28T13:17:56Z] <reedy@deploy1002> reedy and lucaswerkmeister-wmde: Backport for [[gerrit:933880|Set $wgWBRepoSettings['defaultEntityNamespaces'] to false (T291617)]] synced to the testservers: mwdebug1002.eqiad.wmnet, mwdebug1001.eqiad.wmnet, mwdebug2001.codfw.wmnet, mwdebug2002.codfw.wmnet

Mentioned in SAL (#wikimedia-operations) [2023-06-28T13:25:42Z] <reedy@deploy1002> Finished scap: Backport for [[gerrit:933880|Set $wgWBRepoSettings['defaultEntityNamespaces'] to false (T291617)]] (duration: 09m 19s)

Change 933906 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Change defaultEntityNamespaces default to true

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

I think the next steps would be:

  • set defaultEntityNamespaces explicitly to false in our production config

done

  • let defaultEntityNamespaces default to true
    • with a release notes entry warning other wiki operators that they might want to set defaultEntityNamespaces to false in their config
  • remove defaultEntityNamespaces from the example settings

https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/933906

That change, especially the release notes part, could probably use some more work; that probably belongs with the Wikibase Suite team.

Not sure I fully understand the work remaining in this ticket, but I do smell something in the namespace config in repo and think we, WBS team, should understand and explore this further and make amendments accordingly. The conversations and cautions in this ticket should be a helpful guide. Our existing related test suite should also be helpful to understanding.

Keeping this ticket open and moving it to the backlog for further refinement:

Likely this is a Spike with the goal of better understanding the use and configuration of WikibaseRepo in total, with a focus on what could/should be included in our example configuration with regard to it.

That change, especially the release notes part, could probably use some more work; that probably belongs with the Wikibase Suite team.

For NFDI, merging https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/933906 would reduce confusion. For example, only by finding this change on Gerrit I realized that I had to set default entity namespaces to false.

As I understand it, what is remaining in the the example config files seems to be mostly about namespaces. So I wonder if T53051: Set useful and consistent (in client/repo) default namespaces is somehow related to this task here.

As I understand it, what is remaining in the example config files seems to be mostly about namespaces. So I wonder if T53051: Set useful and consistent (in client/repo) default namespaces is somehow related to this task here.

I would assume T53051 is already done. I don't understand why one needs the example config at all

https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/f2bd35609b6bf3f8d38ef8c78d2f340497906706/repo/includes/RepoHooks.php#L170-L175

does set up the default namespaces if they don't exist. So I guess one could delete the wikibase config example file altogether.

In conclusion, I think the proposed change https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/933906 improves the situation but can be extended and updated to REL1.42. However, only if someone might be willing to merge the change in due time it makes sense to discuss the details. Otherwise, it's a waste of time.

Thank you.
I still don't fully understand what will happen to

https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/933906

I implemented that on my wiki locally and took a note that I can undo the local modification once the change was merged...