Page MenuHomePhabricator

Enable Wikibase CI wikis to link to themselves
Closed, ResolvedPublic

Description

In order to integration-test T278962: Allow redirects and the target article as independent sitelinks if redirect badge is used (ideally using API integration tests), we need the test wiki in Wikibase CI jobs to be able to link to itself. Currently, this is not possible: the wiki must first be added to its own sites table, using a group that is then added to the $wgWBRepoSettings['siteLinkGroups'] array in its LocalSettings.php.

This would also be useful for browser tests (I think we currently don’t have any browser tests for sitelink behavior?), so I wouldn’t restrict this to the api-testing jobs.

Event Timeline

I can see three ways to implement this at the moment:

  1. Quibble adds another step to InstallMediaWiki (quibble/command.py) where, after running update.php (and either before or after rebuildLocalisationCache.php), it runs the addSite.php maintenance script, using a certain well-known group name (“local”, “CI”, whatever). We add that group name to the $wgWBRepoSettings['siteLinkGroups'] in Wikibase’s repo/config/Wikibase.ci.php.
  1. Wikibase.ci.php automatically adds an entry for the local wiki to the sites table if it’s not present yet (or perhaps only if the sites table is completely empty); it also still sets $wgWBRepoSettings['siteLinkGroups'].
  1. Wikibase “synthesizes” the site at runtime (e.g. in the SiteLinkTargetProvider service) even if it doesn’t exist in the sites table, controlled by a new CI-only setting that is set by Wikibase.ci.php.

I don’t like that option 1 requires shared knowledge of the group name between Quibble and Wikibase’s CI file; also, this would mean that the tests we want to write are blocked until the next Quibble version is released and used in CI. But in option 2, a PHP file that’s ostensibly config-only would magically change the database, which seems fairly evil; and option 3 feels risky, because who knows how many places assume that a site link target really exists in the sites table (or even just in the SiteLookup service, which is a MediaWiki core service where we might not be able to insert the “synthetic” site). So at the moment, I’m leaning towards option 1.

Change 820744 had a related patch set uploaded (by Michael Große; author: Michael Große):

[integration/quibble@master] Run addSite script to allow setting sitelinks

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

Change 828561 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/quibble@master] release: Quibble 1.4.6

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

Change 820744 merged by jenkins-bot:

[integration/quibble@master] Run addSite script to allow setting sitelinks in tests

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

Change 828574 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/config@master] dockerfiles: update to Quibble 1.4.6

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

Change 828561 merged by jenkins-bot:

[integration/quibble@master] release: Quibble 1.4.6

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

Change 828574 merged by jenkins-bot:

[integration/config@master] dockerfiles: update to Quibble 1.4.6

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

Change 828611 had a related patch set uploaded (by Jforrester; author: Jforrester):

[integration/config@master] jjb: Switch quibble jobs to 1.4.6

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

Change 828611 merged by jenkins-bot:

[integration/config@master] jjb: Switch quibble jobs to 1.4.6

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

Mentioned in SAL (#wikimedia-releng) [2022-09-01T07:43:51Z] <hashar> Updating Jenkins jobs for Quibble 1.4.5 > 1.4.6 + php 7.4 update | T305525 | T314586 | T316601 | https://gerrit.wikimedia.org/r/c/integration/config/+/828611

I have switched the jobs to Quibble 1.4.6 earlier this morning but forgot to ping @Lucas_Werkmeister_WMDE @Michael :)

Michael claimed this task.

Thank you! I can confirm that these are working now. I think we can close this :)