Page MenuHomePhabricator

Run MigrateMentorStatusAway migration script
Open, HighPublic1 Estimated Story Points

Description

In rEGREc7b68947a4480cf63846d9d8926ec022b3ae9353 we introduced a migration script to copy the values for the awayStatusTimestamp from user options to community configuration, however we haven't actually run in production or anywhere yet.

The script checks for differences and valid configuration before storing. Within this task we should check if there are differences in dry mode before the real run so we can analyze if the code that writes into community config is indeed preserving the same data as we used in user options

Acceptance criteria

  • Run script in dry mode and analyze possible differences
  • If the diff is correct, run the script in all growth wikis

Note on the differences: Acceptable differences would be storing a timestamp not updated in a long time (maximum span is 1 year ago), so there could be mentors who haven't updated it after we started writing the values in config around Aug 6 2025/wmf-24 (rEGRE8bfc6b50e7e823396f42c304a3632065bc69af01). No other differences should be found unless we identify an issue with the writing code.

Event Timeline

Sgs renamed this task from Run migration to Run MigrateMentorStatusAway migration script.
Sgs triaged this task as Medium priority.
Sgs updated the task description. (Show Details)
Sgs set the point value for this task to 1.Nov 4 2025, 3:31 PM
KStoller-WMF lowered the priority of this task from Medium to Low.Nov 4 2025, 4:54 PM

I found an issue in the migration script while running it on dry-mode, for instance for eswiki this was the output:

There are changes:
Additions:
{
    "Mentors": {
        "1": {
            "awayTimestamp": "20251118130934"
        },
        "2" {
            "awayTimestamp": "20260623200305"
        }
    }
}
Deletions:
{
    "Mentors": {
        "1": {
            "awayTimestamp": "2025-11-18T13:09:34Z"
        }
    }
}

I forgot to update the script in T406701 and now it would save the values again using unix format rather than ISO. Providing a fix before running.

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

[mediawiki/extensions/GrowthExperiments@master] fix(MigrateMentorStatusAway): ensure migration respects date format

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

Change #1206894 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] fix(MigrateMentorStatusAway): ensure migration respects date format

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

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

[mediawiki/extensions/GrowthExperiments@wmf/1.46.0-wmf.3] fix(MigrateMentorStatusAway): ensure migration respects date format

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

Change #1207118 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@wmf/1.46.0-wmf.3] fix(MigrateMentorStatusAway): ensure migration respects date format

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

Mentioned in SAL (#wikimedia-operations) [2025-11-19T14:30:50Z] <sgimeno@deploy2002> Started scap sync-world: Backport for [[gerrit:1206936|fix(ReviseToneExperimentInteractionLogger): prevent breaking homepage for unsampled users (T405177)]], [[gerrit:1207118|fix(MigrateMentorStatusAway): ensure migration respects date format (T409170)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-19T14:35:28Z] <sgimeno@deploy2002> sgimeno: Backport for [[gerrit:1206936|fix(ReviseToneExperimentInteractionLogger): prevent breaking homepage for unsampled users (T405177)]], [[gerrit:1207118|fix(MigrateMentorStatusAway): ensure migration respects date format (T409170)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-11-19T14:40:00Z] <sgimeno@deploy2002> Finished scap sync-world: Backport for [[gerrit:1206936|fix(ReviseToneExperimentInteractionLogger): prevent breaking homepage for unsampled users (T405177)]], [[gerrit:1207118|fix(MigrateMentorStatusAway): ensure migration respects date format (T409170)]] (duration: 09m 09s)

Not sure why mwscript-k8s is stopping at afwiki when I run this:

sgimeno@deploy2002:~$ mwscript-k8s -f --comment="T409170" --dblist="growthexperiments" -- GrowthExperiments:migrateMentorStatusAway --dry-run
GrowthExperiments:migrateMentorStatusAway: Running on growthexperiments
-----------------------------------------------------------------
abwiki
-----------------------------------------------------------------
abwiki No mentors found in config, skipping migration.
-----------------------------------------------------------------
acewiki
-----------------------------------------------------------------
acewiki No mentors found in config, skipping migration.
-----------------------------------------------------------------
adywiki
-----------------------------------------------------------------
adywiki No mentors found in config, skipping migration.
-----------------------------------------------------------------
afwiki
-----------------------------------------------------------------
afwiki Nothing new to save, skipping

@Urbanecm_WMF is helping to figure out why.

@Urbanecm_WMF is helping to figure out why.

The problem is described in T411104: mwscript-k8s makes it challenging to run LoggedUpdateMaintenance across all wikis, Daniel Kinzler uploaded fixes to Core and GrowthExperiments, which need to be reviewed.

@Sgs also noticed that on kaawiki, the script errors out with:

kaawiki [9360699038247e008416e081] [no req]   TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given

This is happening, because an administrator manually edited the list of mentors to add themselves, and they used a non-existing user ID. Fortunately, that wiki does not have mentorship enabled in CC. I went ahead and fixed the mentor list, and I filled T412187: Help kaa.wikipedia to enable mentorship to check on the wiki (as it seems they attempted to enable mentorship, but unsuccessfully).

Sgs raised the priority of this task from Low to Medium.Dec 16 2025, 5:42 PM
Sgs raised the priority of this task from Medium to High.
Sgs edited projects, added Growth-Team; removed Growth-Team (FY2025-26 Q2 Sprint 5).
Sgs moved this task from Inbox to Blocked on the Growth-Team board.