Page MenuHomePhabricator

Improve behaviour when the configuration page does not exist
Closed, ResolvedPublic

Description

As of now, Community configuration 2.0 treats cases when the configuration page does not exist the same as if the page existed and {} was its content. Originally (in 1.0), this was done as part of T325236. This may or may not be a good idea for all config pages.

This task is filled to think about the correct behaviour here and if needed, implementing any changes we agree on. This was originally brought by @Sgs in WMF Slack.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
KStoller-WMF raised the priority of this task from Low to Medium.Feb 15 2024, 5:27 PM

I think in this case we would want to bail out and show some user error pointing to the provider defined (or not) example page. The error message could include a link to documentation on the definition of JSON config pages in providers/store definitions. How does that sound @Urbanecm_WMF ?

I think in this case we would want to bail out and show some user error pointing to the provider defined (or not) example page. The error message could include a link to documentation on the definition of JSON config pages in providers/store definitions. How does that sound @Urbanecm_WMF ?

I don't think that would be a good idea. That'd basically require users to save the configuration at least one time, even if the wiki actually intends to use the defaults. Alternatively, we'd need a mechanism to create the config page (pre-populated) on installation time. Personally, I think it is easier to fallback to PHP global variables (aka config set in extension.json). That said, perhaps configuration doesn't always have to be 1:1 mapped to "standard" config variables, and erroring out might be more reasonable in other cases? Do we need to make this configurable?

Change 1011326 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/CommunityConfiguration@master] WikiPageConfigProvider: Fallback when store returns invalid data

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

I'm fine with the approach of 1011326 but I wonder if from a user perspective is it confusing to find the default pre-filled in the form on the "first config edition"? Maybe it is just fine. Maybe a follow-up could be to trigger some status that adds a warning text below the field reposrting something like: $1 is the default value for this configuration, consider finding a better suit for your {SITENAME} looking for community consensus (where $1 is the value in the input).

Change 1011326 merged by jenkins-bot:

[mediawiki/extensions/CommunityConfiguration@master] WikiPageConfigProvider: Fallback when store returns invalid data

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

With the defaults enabled, I do not think there is anything else to do here.

Urbanecm_WMF added a subscriber: Etonkovidova.

@Etonkovidova The expected behaviour in this case is that when a config page is set to {} (by a manual edit), then Community configuration behaves as if the default values were used.

@Etonkovidova The expected behaviour in this case is that when a config page is set to {} (by a manual edit), then Community configuration behaves as if the default values were used.

thx, @Urbanecm_WMF - I checked that; also, I checked the case when MediaWiki:ExampleConfig.json was deleted & restored. All seems to be working as expected.