Page MenuHomePhabricator

Use a constant to mark minimum for getting started notification
Closed, ResolvedPublic

Description

GrowthExperiments accesses MediaWiki-extensions-CommunityConfiguration data via a wrapper called MediaWikiConfigReaderWrapper. This wrapper allows us to pre-process certain configuration options before passing them over to the rest of GrowthExperiments. This was done to support otherwise-incompatible changes that are being made as migrating to the CommunityConfiguration extension (from Special:EditGrowthConfig).

One of those pre-processing impacts GELevelingUpKeepGoingNotificationThresholds, which is specified as an integer in CommunityConfiguration extension, but the rest of GrowthExperiments expects a range (one minimum, one maximum). We use the integer specified in CommunityConfiguration as the maximum, and provide a fixed integer as the minimum. Overall, this allows us to follow the promises made in the user interface (see below), without also having to make difficult-to-revert changes across all of GrowthExperiments.

image.png (175×692 px, 35 KB)

This pre-processing is a form of Technical-Debt that should be replaced with a better solution. We used it as an intermediate solution, as we weren't sure which route we want to go through. In T366139: Clarify if the minimum in GELevelingUpKeepGoingNotificationThresholds should be editable, we decided to keep the minimum fixed and non-configurable, as there is no scenario in which changing the minimum would be necessary.

Within this task, we should remove the technical debt mentioned above. Given the decision described above, we can do the following:

  • Create a new configuration variable called GELevelingUpKeepGoingNotificationThresholdsMaximum (or similar), and migrate the current value of GELevelingUpKeepGoingNotificationThresholds from the JSON page to it.
  • Create a constant in LevellingUpManager, which would define the minimum (currently set as 1; although it is overridable both on-wiki and in server-settings, no wiki changed it, and code-wise, the variable is only referred to in GrowthExperiments itself).
  • Remove all usages of GELevelingUpKeepGoingNotificationThresholds with either the constant or GELevelingUpKeepGoingNotificationThresholdsMaximum, as appropriate
  • Drop GELevelingUpKeepGoingNotificationThresholds altogether

Details

Related Changes in Gerrit:
SubjectRepoBranchLines +/-
mediawiki/extensions/GrowthExperimentsmaster+67 -0
mediawiki/extensions/GrowthExperimentsmaster+0 -15
mediawiki/extensions/GrowthExperimentswmf/1.44.0-wmf.17+88 -45
mediawiki/extensions/CommunityConfigurationmaster+7 -1
mediawiki/extensions/GrowthExperimentsmaster+88 -45
mediawiki/extensions/GrowthExperimentswmf/1.44.0-wmf.17+96 -2
mediawiki/extensions/GrowthExperimentsmaster+96 -2
mediawiki/extensions/GrowthExperimentsmaster+3 -0
mediawiki/extensions/GrowthExperimentswmf/1.44.0-wmf.17+98 -3
mediawiki/extensions/GrowthExperimentsmaster+98 -3
mediawiki/extensions/GrowthExperimentswmf/1.44.0-wmf.16+98 -3
mediawiki/extensions/GrowthExperimentsmaster+3 -1
mediawiki/extensions/GrowthExperimentsmaster+15 -0
mediawiki/extensions/GrowthExperimentsmaster+4 -2
mediawiki/extensions/GrowthExperimentsmaster+105 -0
Show related patches Customize query in gerrit

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Urbanecm_WMF moved this task from Inbox to Up Next (estimated tasks) on the Growth-Team board.
Urbanecm_WMF added a project: Technical-Debt.
Cyndymediawiksim changed the task status from Open to In Progress.Jan 7 2025, 7:33 AM
Cyndymediawiksim claimed this task.

Change #1108705 had a related patch set uploaded (by Cyndywikime; author: Cyndywikime):

[mediawiki/extensions/GrowthExperiments@master] LevelingUp: Add maximum suggested edit threshold configuration

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

Change #1108712 had a related patch set uploaded (by Cyndywikime; author: Cyndywikime):

[mediawiki/extensions/GrowthExperiments@master] LevelingUp: Update schema validation for suggested edit thresholds

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

Change #1108718 had a related patch set uploaded (by Cyndywikime; author: Cyndywikime):

[mediawiki/extensions/GrowthExperiments@master] LevelingUp: Add migration script for suggested edits threshold config

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

Change #1108720 had a related patch set uploaded (by Cyndywikime; author: Cyndywikime):

[mediawiki/extensions/GrowthExperiments@master] LevelingUp: Add migration script for notification thresholds

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

Change #1108718 abandoned by Cyndywikime:

[mediawiki/extensions/GrowthExperiments@master] LevelingUp: Add migration script for suggested edits threshold config

Reason:

Abandoned in favour of Id6297d5350a67bfbb7f97164e5083efd26e557b2

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

Change #1108723 had a related patch set uploaded (by Cyndywikime; author: Cyndywikime):

[mediawiki/extensions/GrowthExperiments@master] LevelingUp: Update LevelingUpManager to use new threshold config

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

Change #1108723 abandoned by Cyndywikime:

[mediawiki/extensions/GrowthExperiments@master] LevelingUp: Update LevelingUpManager to use new threshold config

Reason:

Commits squashed into https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/1108705 as per review comment

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

Change #1108712 abandoned by Cyndywikime:

[mediawiki/extensions/GrowthExperiments@master] LevelingUp: Update schema validation for suggested edit thresholds

Reason:

Changes squashed into https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/1108720?tab=checks as per Discussion with Sergio

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

Change #1108705 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] LevelingUp: Add `KEEP_GOING_NOTIFICATION_THRESHOLD_MINIMUM`

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

Change #1115343 had a related patch set uploaded (by Cyndywikime; author: Cyndywikime):

[mediawiki/extensions/GrowthExperiments@master] Remove GELevelingUpKeepGoingNotificationThresholds usages

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

Change #1108720 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] LevelingUp: Schema migration for GELevelingUpKeepGoingNotificationThresholds.

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

@Cyndymediawiksim and I run the following in the beta cluster:

sgimeno@deployment-mwmaint03:~$ foreachwiki extensions/CommunityConfiguration/maintenance/migrateConfig.php --dry-run GrowthHomepage
-----------------------------------------------------------------
aawiki
-----------------------------------------------------------------
InvalidArgumentException from line 102 of /srv/mediawiki/php-master/extensions/CommunityConfiguration/src/Provider/ConfigurationProviderFactory.php: Provider GrowthHomepage is not supported
#0 /srv/mediawiki/php-master/extensions/CommunityConfiguration/src/Provider/ConfigurationProviderFactory.php(115): MediaWiki\Extension\CommunityConfiguration\Provider\ConfigurationProviderFactory->getProviderSpec('GrowthHomepage')
#1 /srv/mediawiki/php-master/extensions/CommunityConfiguration/src/Provider/ConfigurationProviderFactory.php(165): MediaWiki\Extension\CommunityConfiguration\Provider\ConfigurationProviderFactory->constructProvider('GrowthHomepage')
#2 /srv/mediawiki/php-master/extensions/CommunityConfiguration/maintenance/migrateConfig.php(70): MediaWiki\Extension\CommunityConfiguration\Provider\ConfigurationProviderFactory->newProvider('GrowthHomepage')
#3 /srv/mediawiki/php-master/maintenance/includes/MaintenanceRunner.php(695): MediaWiki\Extension\CommunityConfiguration\Maintenance\MigrateConfig->execute()
#4 /srv/mediawiki/php-master/maintenance/run.php(51): MediaWiki\Maintenance\MaintenanceRunner->run()
#5 /srv/mediawiki/multiversion/MWScript.php(156): require_once('/srv/mediawiki/...')
#6 {main}
-----------------------------------------------------------------
apiportalwiki
-----------------------------------------------------------------
InvalidArgumentException from line 102 of /srv/mediawiki/php-master/extensions/CommunityConfiguration/src/Provider/ConfigurationProviderFactory.php: Provider GrowthHomepage is not supported
#0 /srv/mediawiki/php-master/extensions/CommunityConfiguration/src/Provider/ConfigurationProviderFactory.php(115): MediaWiki\Extension\CommunityConfiguration\Provider\ConfigurationProviderFactory->getProviderSpec('GrowthHomepage')
#1 /srv/mediawiki/php-master/extensions/CommunityConfiguration/src/Provider/ConfigurationProviderFactory.php(165): MediaWiki\Extension\CommunityConfiguration\Provider\ConfigurationProviderFactory->constructProvider('GrowthHomepage')
#2 /srv/mediawiki/php-master/extensions/CommunityConfiguration/maintenance/migrateConfig.php(70): MediaWiki\Extension\CommunityConfiguration\Provider\ConfigurationProviderFactory->newProvider('GrowthHomepage')
#3 /srv/mediawiki/php-master/maintenance/includes/MaintenanceRunner.php(695): MediaWiki\Extension\CommunityConfiguration\Maintenance\MigrateConfig->execute()
#4 /srv/mediawiki/php-master/maintenance/run.php(51): MediaWiki\Maintenance\MaintenanceRunner->run()
#5 /srv/mediawiki/multiversion/MWScript.php(156): require_once('/srv/mediawiki/...')
#6 {main}
-----------------------------------------------------------------
arwiki
-----------------------------------------------------------------
Warning: Undefined variable $wmgGEActiveExperiment in /srv/mediawiki/wmf-config/CommonSettings.php on line 4418
Warning: Undefined variable $wmgGEActiveExperiment in /srv/mediawiki/wmf-config/CommonSettings.php on line 4437
LogicException from line 42 of /srv/mediawiki/php-master/extensions/CommunityConfiguration/src/Schema/SchemaMigrator.php: MediaWiki\Extension\CommunityConfiguration\Schema\SchemaMigrator::convertDataToVersion lacks version data
#0 /srv/mediawiki/php-master/extensions/CommunityConfiguration/maintenance/migrateConfig.php(83): MediaWiki\Extension\CommunityConfiguration\Schema\SchemaMigrator->convertDataToVersion(Object(MediaWiki\Extension\CommunityConfiguration\Provider\MediaWikiConfigProvider), '2.0.0')
#1 /srv/mediawiki/php-master/maintenance/includes/MaintenanceRunner.php(695): MediaWiki\Extension\CommunityConfiguration\Maintenance\MigrateConfig->execute()
#2 /srv/mediawiki/php-master/maintenance/run.php(51): MediaWiki\Maintenance\MaintenanceRunner->run()
#3 /srv/mediawiki/multiversion/MWScript.php(156): require_once('/srv/mediawiki/...')
#4 {main}
...

There are two types of errors. Not supported providers which seem fine but we may want the script to output something smoother, eg: Skipping unsupported provider. For the lacks version data error we should run first the setVersionData script across wikis, with the right version for each schema. So we run:

> foreachwiki extensions/CommunityConfiguration/maintenance/setVersionData.php GrowthHomepage 1.0.0
...
zhwiki:  All done!

And finally:

> foreachwiki extensions/CommunityConfiguration/maintenance/migrateConfig.php GrowthHomepage
...
zhwiki:  All done!

Do these sound as fair steps to repeat in production? cc @Urbanecm_WMF

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

[mediawiki/extensions/GrowthExperiments@wmf/1.44.0-wmf.16] LevelingUp: Schema migration for GELevelingUpKeepGoingNotificationThresholds.

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

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

[mediawiki/extensions/GrowthExperiments@wmf/1.44.0-wmf.17] LevelingUp: Schema migration for GELevelingUpKeepGoingNotificationThresholds.

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

Change #1121338 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@wmf/1.44.0-wmf.17] LevelingUp: Schema migration for GELevelingUpKeepGoingNotificationThresholds.

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

Change #1121337 abandoned by Sergio Gimeno:

[mediawiki/extensions/GrowthExperiments@wmf/1.44.0-wmf.16] LevelingUp: Schema migration for GELevelingUpKeepGoingNotificationThresholds.

Reason:

Miss-behaves when saving through the editor

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

Mentioned in SAL (#wikimedia-operations) [2025-02-20T12:52:50Z] <sgimeno@deploy2002> Started scap sync-world: Backport for [[gerrit:1121338|LevelingUp: Schema migration for GELevelingUpKeepGoingNotificationThresholds. (T369551)]], [[gerrit:1121358|Revert "LevelingUp: Schema migration for GELevelingUpKeepGoingNotificationThresholds."]]

Mentioned in SAL (#wikimedia-operations) [2025-02-20T12:55:56Z] <sgimeno@deploy2002> sgimeno: Backport for [[gerrit:1121338|LevelingUp: Schema migration for GELevelingUpKeepGoingNotificationThresholds. (T369551)]], [[gerrit:1121358|Revert "LevelingUp: Schema migration for GELevelingUpKeepGoingNotificationThresholds."]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Prior to running the migration in production we realized (credit to @Urbanecm_WMF) that the change in the CC hooks (see 1121338/comment/9a0a56d6_2e3b2134/) makes the editor remove the old property from the stored blob. This would make the feature miss-behave until we don't finalize the switch to the new property, hence we decided to abort the migration and revert the change.

@Cyndymediawiksim will re-work the two changes so (1) the first change keeps json config as expected when saved through the editor and (2) the second change performs a migration to remove the old propperty.

Mentioned in SAL (#wikimedia-operations) [2025-02-20T13:03:33Z] <sgimeno@deploy2002> Finished scap sync-world: Backport for [[gerrit:1121338|LevelingUp: Schema migration for GELevelingUpKeepGoingNotificationThresholds. (T369551)]], [[gerrit:1121358|Revert "LevelingUp: Schema migration for GELevelingUpKeepGoingNotificationThresholds."]] (duration: 10m 43s)

Change #1122096 had a related patch set uploaded (by Cyndywikime; author: Cyndywikime):

[mediawiki/extensions/GrowthExperiments@master] Fix: configuration migration for notification thresholds

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

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

[mediawiki/extensions/GrowthExperiments@master] LevelingUp: schema migration for GELevelingUpKeepGoingNotificationThresholds

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

Change #1122131 had a related patch set uploaded (by Cyndywikime; author: Cyndywikime):

[mediawiki/extensions/CommunityConfiguration@master] Improve error handling in migrateConfig maintenance script

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

Change #1122096 abandoned by Cyndywikime:

[mediawiki/extensions/GrowthExperiments@master] Fix: configuration migration for notification thresholds

Reason:

Abandoned in favour of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/1122109

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

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

[mediawiki/extensions/GrowthExperiments@wmf/1.44.0-wmf.17] LevelingUp: schema migration for GELevelingUpKeepGoingNotificationThresholds

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

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

[mediawiki/extensions/GrowthExperiments@wmf/1.44.0-wmf.17] Remove GELevelingUpKeepGoingNotificationThresholds usages

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

Change #1122109 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] LevelingUp: schema migration for GELevelingUpKeepGoingNotificationThresholds

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

Change #1115343 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Remove GELevelingUpKeepGoingNotificationThresholds usages

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

Mentioned in SAL (#wikimedia-operations) [2025-02-24T15:21:01Z] <sergi0> Run foreachwikiindblist growthexperiments CommunityConfiguration:setVersionData GrowthHomepage 1.0.0 T369551

Change #1122156 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@wmf/1.44.0-wmf.17] LevelingUp: schema migration for GELevelingUpKeepGoingNotificationThresholds

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

Mentioned in SAL (#wikimedia-operations) [2025-02-24T15:23:15Z] <sgimeno@deploy2002> Started scap sync-world: Backport for [[gerrit:1122156|LevelingUp: schema migration for GELevelingUpKeepGoingNotificationThresholds (T369551)]]

Change #1122131 abandoned by Cyndywikime:

[mediawiki/extensions/CommunityConfiguration@master] Improve error handling in migrateConfig maintenance script

Reason:

Abandoned in favour of : https://gerrit.wikimedia.org/r/c/mediawiki/extensions/CommunityConfiguration/+/1121352

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

Mentioned in SAL (#wikimedia-operations) [2025-02-24T15:38:32Z] <sgimeno@deploy2002> sgimeno: Backport for [[gerrit:1122156|LevelingUp: schema migration for GELevelingUpKeepGoingNotificationThresholds (T369551)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2025-02-24T15:50:09Z] <sgimeno@deploy2002> Finished scap sync-world: Backport for [[gerrit:1122156|LevelingUp: schema migration for GELevelingUpKeepGoingNotificationThresholds (T369551)]] (duration: 26m 53s)

Change #1122158 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@wmf/1.44.0-wmf.17] Remove GELevelingUpKeepGoingNotificationThresholds usages

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

Mentioned in SAL (#wikimedia-operations) [2025-02-24T15:54:21Z] <sgimeno@deploy2002> Started scap sync-world: Backport for [[gerrit:1122158|Remove GELevelingUpKeepGoingNotificationThresholds usages (T369551)]]

Mentioned in SAL (#wikimedia-operations) [2025-02-24T15:57:17Z] <sergi0> Run sgimeno@mwmaint2002:~$ foreachwikiindblist growthexperiments CommunityConfiguration:migrateConfig GrowthHomepage 2.0.0 T369551

Mentioned in SAL (#wikimedia-operations) [2025-02-24T16:09:55Z] <sgimeno@deploy2002> sgimeno: Backport for [[gerrit:1122158|Remove GELevelingUpKeepGoingNotificationThresholds usages (T369551)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2025-02-24T16:20:32Z] <sgimeno@deploy2002> Finished scap sync-world: Backport for [[gerrit:1122158|Remove GELevelingUpKeepGoingNotificationThresholds usages (T369551)]] (duration: 26m 10s)

Mentioned in SAL (#wikimedia-operations) [2025-02-24T16:23:44Z] <sergi0> Run sgimeno@mwmaint2002:~$ foreachwikiindblist growthexperiments CommunityConfiguration:migrateConfig GrowthHomepage 2.0.1 T369551

Change #1122185 had a related patch set uploaded (by Cyndywikime; author: Cyndywikime):

[mediawiki/extensions/GrowthExperiments@master] Remove GELevelingUpKeepGoingNotificationThresholds usages

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

Change #1122185 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Remove GELevelingUpKeepGoingNotificationThresholds usages

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

Change #1122572 had a related patch set uploaded (by Cyndywikime; author: Cyndywikime):

[mediawiki/extensions/GrowthExperiments@master] Add unit test for LevelingUpManager::shouldSendKeepGoingNotification

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

Etonkovidova subscribed.

The current behavior for "getting started" notifications (and "keep going") was checked on testwiki wmf.18 - works as expected.

Change #1122572 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add unit test for LevelingUpManager::shouldSendKeepGoingNotification

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