Page MenuHomePhabricator

Stop calling WikibaseSettings::getRepoSettings()/getClientSettings()
Closed, ResolvedPublic

Description

Several places in Wikibase call WikibaseSettings::getRepoSettings() or WikibaseSettings::getClientSettings() directly, instead of getting the settings from elsewhere. This is wasteful, because WikibaseSettings doesn’t cache the settings – each time it’s called, the work of loading the settings and merging them with the default settings is repeated. (Also, settings that are specified as callbacks may be recalculated, even if another settings instance already resolved the callback.) Most of these calls should be replaced with calls to WikibaseRepo::getSettings() or WikibaseClient::getSettings(), optionally passing a $services container into them if available.

Event Timeline

Change 670429 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] WIP: Get settings from service container

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

I noticed one of those places in the client wiring and uploaded the above change to fix it, but then saw that the same thing happens in other places too, so I figure this deserves a proper task and should go through all the columns. Feel free to pick this up.

Change 670555 had a related patch set uploaded (by Itamar Givon; owner: Itamar Givon):
[mediawiki/extensions/Wikibase@master] WikibaseRepo: Get settings from service container

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

Change 670429 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] WikibaseClient: Get settings from service container

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

Change 670555 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] WikibaseRepo: Get settings from service container

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