Page MenuHomePhabricator

🔗 Make sitelink URLs work in CI
Closed, ResolvedPublic

Description

While working on the parent task we discovered that the CI wiki has trouble building URLs for sitelinks linking to an article on the wiki itself. The same error can be produced locally by configuring the wiki "site" (via addSite.php) without a pagepath. The same might be the case for the CI wiki.

Stack trace (logs):

2023-03-03 13:13:19 afad85161f96 wikidb: [59ebfe0c3027ce06ae46729c] /rest.php/wikibase/v0/entities/items/Q60   TypeError: Return value of Wikibase\Repo\RestApi\Infrastructure\SiteLinksReadModelConverter::buildUrl() must be of the type string, null returned
#0 /workspace/src/extensions/Wikibase/repo/rest-api/src/Infrastructure/SiteLinksReadModelConverter.php(29): Wikibase\Repo\RestApi\Infrastructure\SiteLinksReadModelConverter->buildUrl(MediaWikiSite, string)
#1 [internal function]: Wikibase\Repo\RestApi\Infrastructure\SiteLinksReadModelConverter->Wikibase\Repo\RestApi\Infrastructure\{closure}(Wikibase\DataModel\SiteLink)
#2 /workspace/src/extensions/Wikibase/repo/rest-api/src/Infrastructure/SiteLinksReadModelConverter.php(31): array_map(Closure, array)
#3 /workspace/src/extensions/Wikibase/repo/rest-api/src/DataAccess/WikibaseEntityLookupItemDataRetriever.php(78): Wikibase\Repo\RestApi\Infrastructure\SiteLinksReadModelConverter->convert(Wikibase\DataModel\SiteLinkList)
#4 /workspace/src/extensions/Wikibase/repo/rest-api/src/DataAccess/WikibaseEntityLookupItemDataRetriever.php(56): Wikibase\Repo\RestApi\DataAccess\WikibaseEntityLookupItemDataRetriever->itemDataFromRequestedFields(array, Wikibase\DataModel\Entity\Item)
...

This means that SiteLookup->getSite() returned a Site object, but the following Site->getPageUrl() call returned null.

Acceptance criteria:

  • sitelink URLs work in CI
  • any hack (not merged yet) to make CI happy in the meantime is removed
  • double check with PM whether misconfigured sites is something we need to account for

Event Timeline

Since I saw it questioned if sitelinks to own wiki are a thing and if this is only a Wikidata thing: We have quite a few Items on Wikidata that have a sitelink to Wikidata. This includes discussion spaces, wiki projects, help pages, etc.
There are also other Wikibase installations that do this when they don't want to put up with having their own separate client wiki but instead use the same wiki as client as well.

Change 900370 had a related patch set uploaded (by Jakob; author: Jakob):

[integration/quibble@master] Configure local wiki site with page path

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

Change 900383 had a related patch set uploaded (by Jakob; author: Jakob):

[mediawiki/extensions/Wikibase@master] REST: Add sitelink URL e2e test

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

Change 900384 had a related patch set uploaded (by Jakob; author: Jakob):

[mediawiki/extensions/Wikibase@master] REST: Remove hack for missing page path config

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

Jakob_WMDE changed the task status from Open to Stalled.Mar 21 2023, 10:05 AM

This is blocked by T332386

This is caused by the npm dependencies wdio-syncfibers the later is no more supported by NodeJS 16. So you will want to run the tests with NodeJS 14.

edited the node:fs is not available in NodeJS 14.17 used by CI. That task is to update the CI infra to 14.18.

We cannot update to NodeJS 16 yet cause that breaks fibers which is a dependency of wdio-sync (used by Webdriver.io` selenium tests).

@hashar sorry about the confusion. We don't have any issues related to the node version used in CI. We need to make an adjustment to the CI wiki's site config in quibble (this patch) in order to get this task done. I marked it as stalled as I understand quibble CI to currently be broken due to T332386.

Jakob_WMDE changed the task status from Stalled to Open.Mar 30 2023, 10:55 AM

Change 900370 merged by jenkins-bot:

[integration/quibble@master] Configure local wiki site with page path

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

Change 900370 merged by jenkins-bot:

[integration/quibble@master] Configure local wiki site with page path

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

Note this still requires a release of Quibble and upgrading all the CI container images to the new version ;)

Note this still requires a release of Quibble and upgrading all the CI container images to the new version ;)

Yes, thanks. I set myself a reminder to check for a new quibble release in a few weeks :D

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

[integration/quibble@master] release: Quibble 1.5.4

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

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

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

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

Change 904867 merged by jenkins-bot:

[integration/quibble@master] release: Quibble 1.5.4

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

Change 905167 merged by jenkins-bot:

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

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

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

[integration/config@master] jjb: update Quibble jobs to 1.5.4

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

Change 905190 merged by jenkins-bot:

[integration/config@master] jjb: update Quibble jobs to 1.5.4

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

Change 900383 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Test all data in `GET item` e2e test

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

Change 900384 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Remove hack for missing page path config

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