Page MenuHomePhabricator

Wikibase gate-and-submit failing: “is not safe to call SpecialPage::getContext() (possible indirectly by other get*() functions)”
Closed, ResolvedPublic

Description

https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-noselenium-docker/123575/console

18:38:01 There were 4 failures:
18:38:01 
18:38:01 1) SpecialPageFatalTest::testSpecialPageDoesNotFatal with data set "GlobalGroupMembership" ('GlobalGroupMembership')
18:38:01 MediaWiki\Extension\CentralAuth\Special\SpecialGlobalGroupMembership::__construct is not safe to call SpecialPage::getContext() (possible indirectly by other get*() functions)
18:38:01 
18:38:01 /workspace/src/tests/phpunit/structure/SpecialPageFatalTest.php:51
18:38:01 /workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:452
18:38:01 === Logs generated by test case
18:38:01 [objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
18:38:01 [localisation] [debug] LocalisationCache using store LCStoreNull []
18:38:01 [localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
18:38:01 [wfDebug] [debug] SpecialPage::getContext called and $mContext is null. Using RequestContext::getMain() {"private":false}
18:38:01 [GlobalTitleFail] [info] RequestContext::getTitle called with no title set. {"exception":{}}
18:38:01 [MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
18:38:01 [GlobalTitleFail] [info] RequestContext::getTitle called with no title set. {"exception":{}}
18:38:01 ===
18:38:01 
18:38:01 2) SpecialPageFatalTest::testSpecialPageDoesNotFatal with data set "GlobalRenameProgress" ('GlobalRenameProgress')
18:38:01 MediaWiki\Extension\CentralAuth\Special\SpecialGlobalRenameProgress::__construct is not safe to call SpecialPage::getContext() (possible indirectly by other get*() functions)
18:38:01 
18:38:01 /workspace/src/tests/phpunit/structure/SpecialPageFatalTest.php:51
18:38:01 /workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:452
18:38:01 === Logs generated by test case
18:38:01 [objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
18:38:01 [localisation] [debug] LocalisationCache using store LCStoreNull []
18:38:01 [localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
18:38:01 [wfDebug] [debug] SpecialPage::getContext called and $mContext is null. Using RequestContext::getMain() {"private":false}
18:38:01 [GlobalTitleFail] [info] RequestContext::getTitle called with no title set. {"exception":{}}
18:38:01 [MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
18:38:01 [GlobalTitleFail] [info] RequestContext::getTitle called with no title set. {"exception":{}}
18:38:01 ===
18:38:01 
18:38:01 3) SpecialPageFatalTest::testSpecialPageDoesNotFatal with data set "GlobalUserMerge" ('GlobalUserMerge')
18:38:01 MediaWiki\Extension\CentralAuth\Special\SpecialGlobalUserMerge::__construct is not safe to call SpecialPage::getContext() (possible indirectly by other get*() functions)
18:38:01 
18:38:01 /workspace/src/tests/phpunit/structure/SpecialPageFatalTest.php:51
18:38:01 /workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:452
18:38:01 === Logs generated by test case
18:38:01 [objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
18:38:01 [localisation] [debug] LocalisationCache using store LCStoreNull []
18:38:01 [localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
18:38:01 [wfDebug] [debug] SpecialPage::getContext called and $mContext is null. Using RequestContext::getMain() {"private":false}
18:38:01 [GlobalTitleFail] [info] RequestContext::getTitle called with no title set. {"exception":{}}
18:38:01 [MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
18:38:01 [GlobalTitleFail] [info] RequestContext::getTitle called with no title set. {"exception":{}}
18:38:01 ===
18:38:01 
18:38:01 4) SpecialPageFatalTest::testSpecialPageDoesNotFatal with data set "ConstraintReport" ('ConstraintReport')
18:38:01 WikibaseQuality\ConstraintReport\Specials\SpecialConstraintReport::__construct is not safe to call SpecialPage::getContext() (possible indirectly by other get*() functions)
18:38:01 
18:38:01 /workspace/src/tests/phpunit/structure/SpecialPageFatalTest.php:51
18:38:01 /workspace/src/tests/phpunit/MediaWikiIntegrationTestCase.php:452
18:38:01 === Logs generated by test case
18:38:01 [objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
18:38:01 [localisation] [debug] LocalisationCache using store LCStoreNull []
18:38:01 [localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
18:38:01 [Wikibase] [debug] {method}: setting {settingName} was given as a closure, resolve it to {logValue} {"method":"Wikibase\\Lib\\SettingsArray::getSetting","settingName":"entitySources","logValue":"array (\n  'local' => \n  array (\n    'entityNamespaces' => \n    array (\n      'item' => 120,\n      'property' => 122,\n      'lexeme' => 146,\n      'mediainfo' => '6\/mediainfo',\n    ),\n    'repoDatabase' => false,\n    'baseUri' => 'http:\/\/127.0.0.1:9412\/entity\/',\n    'rdfNodeNamespacePrefix' => 'wd',\n    'rdfPredicateNamespacePrefix' => '',\n    'interwikiPrefix' => '',\n  ),\n)"}
18:38:01 [wfDebug] [debug] SpecialPage::getContext called and $mContext is null. Using RequestContext::getMain() {"private":false}

Event Timeline

Making High for now, if it turns out to affect other extensions (which I assume it will, since the failing special pages include CentralAuth ones) that should be bumped to UBN.

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

[mediawiki/extensions/CentralAuth@master] DNM: Empty change to test CI

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

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

[mediawiki/core@master] Revert \"tests: Special page constructor are not allow to call getContext\"

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

The CentralAuth special page might be relatively easy to fix. In WikibaseQualityConstraints I’d say it’s less straightforward, the constructor initializes several other services based on the request language. I suggest reverting for now.

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

[mediawiki/extensions/CentralAuth@master] Don\u2019t create CentralAuthUser in special page constructor

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

Change 743468 abandoned by Lucas Werkmeister (WMDE):

[mediawiki/extensions/CentralAuth@master] DNM: Empty change to test CI

Reason:

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

The CentralAuth special page might be relatively easy to fix.

It turns out the CentralAuth fix isn’t as easy as it looked either, the $this->addHelpLink() call also needs to be moved somewhere.

Change 743470 abandoned by Lucas Werkmeister (WMDE):

[mediawiki/extensions/CentralAuth@master] Don\u2019t create CentralAuthUser in special page constructor

Reason:

already done more comprehensively in Id6b4836da1, it turns out

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

Change 743422 merged by jenkins-bot:

[mediawiki/core@master] Revert \"tests: Special page constructor are not allow to call getContext\"

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

The CentralAuth special page might be relatively easy to fix.

It turns out the CentralAuth fix isn’t as easy as it looked either, the $this->addHelpLink() call also needs to be moved somewhere.

Patch already uploaded and now merged - https://gerrit.wikimedia.org/r/c/mediawiki/extensions/CentralAuth/+/743456

Lucas_Werkmeister_WMDE lowered the priority of this task from Unbreak Now! to High.

Wikibase gate-and-submit passes again, no longer UBN.

I don’t agree that this is done already, as I assume you’ll want to revert the revert eventually.

I don’t agree that this is done already, as I assume you’ll want to revert the revert eventually.

As that can take some more time to verify, I have created T297203