Page MenuHomePhabricator

GrowthExperiments CommunityConfiguration: Add minimum and maximum validation constraints to applicable fields
Closed, ResolvedPublic

Description

Since T365147: CommunityConfiguration: Support minimum / maximum validation constraints for JSONSchema, MediaWiki-extensions-CommunityConfiguration makes it possible for extensions such as GrowthExperiments to specify minimum/maximum value for numbers and integers. This can be used to improve user experience by disallowing negative numbers for fields where negative numbers do not make any sense, such as Maximum number of links to show per task in https://es.wikipedia.beta.wmflabs.org/wiki/Especial:CommunityConfiguration/GrowthSuggestedEdits.

Within this task, we should review all usages of TYPE_NUMBER and TYPE_INTEGER in GrowthExperiments, and consider whether they need a minimum/maximum set, or whether any number is okay. As part of this task, we should only consider technical concerns (rather than product ones) – for example, we would be fine with any positive number for Maximum number of links to show per task (although including 200 links in a single task is likely not desirable from product PoV).

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change #1041590 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/extensions/GrowthExperiments@master] Config: add minimum to integers in schemas

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

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

[mediawiki/extensions/GrowthExperiments@master] Improve explanation for underlinkedWeight / minimumLinkScore

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

Change #1041590 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Config: add minimum to integers in schemas

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

Change #1046610 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Improve explanation for underlinkedWeight / minimumLinkScore

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

Michael subscribed.

Is this done enough that it should go to QA or is there more work needed here until the Acceptance Criteria are met?

I think this should be enough for now – all numerical fields should now have reasonable validation rules.

Etonkovidova subscribed.

I think this should be enough for now – all numerical fields should now have reasonable validation rules.

Checked in testwiki wmf.10 - min values (no less than 0) and no decimal numbers have good validation in place:

Screen Shot 2024-06-18 at 1.55.11 PM.png (1,582×802 px, 121 KB)
Screen Shot 2024-06-18 at 5.08.45 PM.png (1,514×1,250 px, 234 KB)

There are only two cases where the validation can be improved - filed as T367936

  • entering e.g. 3.e10 is accepted as a number
  • fields without any values are removed. I tried to test on more on this case, i.e find if it's going to really break functionality, but everything looks solid.