Page MenuHomePhabricator

WikidataPageBanner incompatible with latest Wikidata
Closed, InvalidPublic

Description

Exception encountered, of type "InvalidArgumentException"
[9528a12b] /wiki/Shanghai InvalidArgumentException from line 33 of /vagrant/mediawiki/extensions/WikidataBuildResources/vendor/wikibase/data-model/src/Entity/PropertyId.php: $idSerialization must match /^P[1-9]\d*$/i
Backtrace:
#0 /vagrant/mediawiki/extensions/WikidataBuildResources/vendor/wikibase/data-model/src/Entity/PropertyId.php(23): Wikibase\DataModel\Entity\PropertyId->assertValidIdFormat(string)
#1 /vagrant/mediawiki/extensions/WikidataPageBanner/includes/WikidataPageBanner.hooks.php(276): Wikibase\DataModel\Entity\PropertyId->__construct(string)
#2 /vagrant/mediawiki/extensions/WikidataPageBanner/includes/WikidataPageBanner.hooks.php(23): WikidataPageBanner::getWikidataBanner(Title)
#3 [internal function]: WikidataPageBanner::addBanner(OutputPage, SkinMinerva)
#4 /vagrant/mediawiki/includes/Hooks.php(204): call_user_func_array(string, array)
#5 /vagrant/mediawiki/includes/OutputPage.php(2309): Hooks::run(string, array)
#6 /vagrant/mediawiki/includes/MediaWiki.php(685): OutputPage->output()
#7 /vagrant/mediawiki/includes/MediaWiki.php(474): MediaWiki->main()
#8 /vagrant/mediawiki/index.php(41): MediaWiki->run()
#9 /var/www/w/index.php(5): require(string)
#10 {main}

Event Timeline

Jdlrobson raised the priority of this task from to Needs Triage.
Jdlrobson updated the task description. (Show Details)
Jdlrobson moved this task to June 26-July 18 on the Wikidata-Page-Banner board.
Jdlrobson subscribed.
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Jdlrobson set Security to None.

Please note that just loading things from Wikibase will break, there are no stability guarantees. At the minimum the code in question should have phpunit integration tests that are run together with Wikibase enabled. Otherwise nobody will notice before changes get deployed. It would be even better if we could work out interfaces that should have stability guaranties and then version them.
@hoo: We discussed that before and I can't find the task about that, do you know where it is?

It seems unlikely in this case that it was caused by a change as that file last changed in Nov 2014: https://github.com/wmde/WikibaseDataModel/blob/master/src/Entity/PropertyId.php

What did you set $wgBannerProperty to? (As far as I see the string that causes this exception is from that setting.)

Jdlrobson claimed this task.
Jdlrobson added a subscriber: Sumit.

If you cannot guarantee stability then we should definitely get Wikibase running unit tests for this extension. Who would be best person to make that happen? I'll open a task.

On a side note, I've discovered this is actually an error not on master but with a patch in code review. I'll be sure to get @Sumit to write a test for it to avoid this.

Because I couldn't find the task I mentioned above, I created a new one: T106773: find extensions using code directly from Wikibase and provide mechanism with a stable interface

If you cannot guarantee stability then we should definitely get Wikibase running unit tests for this extension. Who would be best person to make that happen? I'll open a task.

First the other way around. You can add Wikidata as a dependency of WikidataPageBanner to its test job in integration/config.git/zuul/ext_dependencies.py . Then to run those tests before deployment T96264 needs to be done and WikidataPageBanner also needs to be added to the mediawiki-extensions-hhvm job. I'll be there for questions and/or reviewing CI changes.