Page MenuHomePhabricator

Support multiple patterns for matching temporary user account names
Closed, ResolvedPublic3 Estimated Story Points

Description

Background

We are changing the format of temporary user names based on user research: T345855: Update temporary username format . On our beta sites, this is complicated by the fact that temporary users have already been created using the old format.

We investigated whether to rename the old users, and decided not to do that, but instead to support recognizing multiple naming formats as temporary users. Investigation: T349489: Investigate: What would be needed for renaming temporary accounts on beta

What needs doing

MediaWiki recognizes a temporary account user by comparing the name to $wgAutoCreateTempUser['matchPattern'] in RealTempUserConfig::isTempName.

It should be possible to define more than one pattern in $wgAutoCreateTempUser['matchPattern'].

This may involve $wgAutoCreateTempUser['matchPattern'] accepting an array of strings, and the RealTempUserConfig->matchPattern property holding an array of Patterns.

QA Results - Beta

Event Timeline

The code in ApiQuerySiteInfo::appendAutoCreateTempUser may also need an update as it returns the matchPattern in an API response.

Dreamy_Jazz set the point value for this task to 2.Jan 10 2024, 10:51 PM

Change 989625 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] [WIP] Support multiple matchPatterns in temp user autocreate config

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

Change 989626 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CentralAuth@master] [WIP] Replace usage of deprecated TempUserConfig::getMatchPattern

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

Change 989627 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/GrowthExperiments@master] [WIP] Replace deprecated TempUserConfig::getMatchPattern and use query builder

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

This makes sense as a generic capability (maybe we'll want to change username patterns agains when temp users are already in production) but for the specific problem, I don't think anyone would miss those temp users on Beta if they were gone (turned into normal users, I guess?).

This makes sense as a generic capability (maybe we'll want to change username patterns agains when temp users are already in production) but for the specific problem, I don't think anyone would miss those temp users on Beta if they were gone (turned into normal users, I guess?).

These would essentially become normal users. However, if the user_is_temp column is ever used then we would have an inconsistency (as the DB flags the users as temporary but the matching patterns says not) unless we updated the DB or updated the code to read the status from the DB instead of matching to patterns.

Change 989625 merged by jenkins-bot:

[mediawiki/core@master] Support multiple matchPatterns in temp user autocreate config

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

Change 989626 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] Replace usage of deprecated TempUserConfig::getMatchPattern

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

Change 991645 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Add wfDeprecated call to RealTempUserConfig::getMatchPattern

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

Change 989627 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Replace deprecated TempUserConfig::getMatchPattern and use query builder

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

Change 991645 merged by jenkins-bot:

[mediawiki/core@master] Add wfDeprecated call to RealTempUserConfig::getMatchPattern

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