Ladsgroup created this task.
Ladsgroup added projects: Wikidata, MediaWiki-Configuration.
Restricted Application added a subscriber: Aklapper.
TASK DESCRIPTION
The current configuration system in Wikibase depends on two global variables:
`$wgWBRepoSettings` and `$wgWBClientSettings` and sysadmins can customize a
wiki by modifying this global variable directly:
$wgWBRepoSettings['serializationFormat'] = 'application/json';
and in turn, WikibaseSettings tries to build a SettingsArray (this class has
issues like being mutable meaning config can change on the fly, joy). This also
means merging configuration can be tricky and complicated: T257447: Don’t load
Repo settings in PHP entry point <https://phabricator.wikimedia.org/T257447>
and T256252: Migrate wgWBClientDataTypes + wgWBClientSettings loading out of
Client PHP entry point <https://phabricator.wikimedia.org/T256252>.
The plausible solution is to migrate to config management in core:
Documentation
<https://www.mediawiki.org/wiki/Manual:Configuration_for_developers>. But any
sort of work requires lots of changes by sysadmins (like
`$wgWBRepoSettings['serializationFormat'] ` ->
`$wgWBRepoSettingsSerializationFormat` ) and keeping backward compatibility is
borderline impossible (what if one of them gets overriden by the sysadmin and
not the other, what if they diverge drastically, etc..). So here's my proposed
solution:
- Define a new implementation of Config in core, something like
`GlobalArrayConfig` (vs. `GlobalVarConfig`). Which takes name of a global array
(like `$wgWBRepoSettings`) and returns the configs as part of that array.
- Make ConfigFactory work with ObjectFactory, so we would be able to define
such thing in extension.json and set the variable name for Wikibase:
{
"ConfigRegistry": {
"wikibaseRepo": {
"factory": "GlobalArrayConfig::newInstance",
"args": ["wgWBRepoSettings"]
}
}
}
- Build an adapter for `Config` to `SettingsArray` and use it in
WikibaseSettings.
- Slowly migrate configs to extnesion.json
- Drop WikibaseSettings and other bits
Does this make sense?
TASK DETAIL
https://phabricator.wikimedia.org/T258658
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Ladsgroup
Cc: ItamarWMDE, Addshore, Tarrow, Lucas_Werkmeister_WMDE, Jdforrester-WMF,
daniel, Legoktm, Aklapper, Ladsgroup, Akuckartz, darthmon_wmde, DannyS712,
Nandana, Lahi, Gq86, GoranSMilovanovic, Jayprakash12345, QZanden, LawExplorer,
_jensen, rosalieper, Scott_WUaS, MGChecker, Wikidata-bugs, aude, Mbch331, Rxy,
Jay8g, Krenair
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs