Page MenuHomePhabricator

Update $wgAutoCreateTempUser defaults with production settings
Closed, ResolvedPublic2 Estimated Story Points

Assigned To
Authored By
kostajh
Mar 6 2024, 1:02 PM
Referenced Files
F44587415: image.png
Fri, Apr 5, 4:03 AM
F44587378: image.png
Fri, Apr 5, 4:03 AM
Unknown Object (File)
Fri, Apr 5, 3:50 AM
Unknown Object (File)
Fri, Apr 5, 3:50 AM
F44584918: image.png
Fri, Apr 5, 3:44 AM
F44584767: image.png
Fri, Apr 5, 3:43 AM
F44584265: image.png
Fri, Apr 5, 3:39 AM
F44584230: image.png
Fri, Apr 5, 3:39 AM

Description

In T349503: Update the serial mapping config for generating temporary user names on beta and T349486: Change temporary user pattern configuration on beta to match the updated prefix we updated $wgAutoCreateTempUser in the operations/mediawiki-config repo. The full value on dewiki beta is:

> $wgAutoCreateTempUser;
= [
    "enabled" => true,
    "actions" => [
      "edit",
    ],
    "genPattern" => "~$1",
    "matchPattern" => [
      "*$1",
      "~2$1",
    ],
    "reservedPattern" => "~$1",
    "serialProvider" => [
      "type" => "centralauth",
      "numShards" => 8,
      "useYear" => true,
    ],
    "serialMapping" => [
      "type" => "plain-numeric",
    ],
    "expireAfterDays" => 365,
    "notifyBeforeExpirationDays" => 10,
  ]

The default settings for $wgAutoCreateTempUser in core is:

> $wgAutoCreateTempUser
= [
    "enabled" => false,
    "actions" => [
      "edit",
    ],
    "genPattern" => "*Unregistered $1",
    "matchPattern" => "*$1",
    "reservedPattern" => null,
    "serialProvider" => [
      "type" => "local",
    ],
    "serialMapping" => [
      "type" => "plain-numeric",
    ],
    "expireAfterDays" => null,
    "notifyBeforeExpirationDays" => null,
  ]

This task proposes to update the defaults in core, so that we have a consistent developer experience (T359043: Enable temp account creation in DevelopmentSettings.php) and require fewer overrides in operations/mediawiki-config.git.

Specifically, in core, set:

  • "genPattern" => "~$1"
  • "matchPattern" => null,
  • "reservedPattern" => "~$1",
  • "serialProvider" => [ 'type' => 'local', 'useYear' => true ]
  • "expireAfterDays" => 365,
  • "notifyBeforeExpirationDays" => 10,

These changes are also relevant to T355880: Decide long term strategy for temp account default

Event Timeline

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

[mediawiki/core@master] Update wgAutoCreateTempUser config defaults

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

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

[mediawiki/extensions/CheckUser@master] Use TempUserConfig over getting raw value from wgAutoCreateTempUser

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

Change #1014583 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Use TempUserConfig over getting raw value from wgAutoCreateTempUser

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

Change #1014530 merged by jenkins-bot:

[mediawiki/core@master] Update wgAutoCreateTempUser config defaults

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

Suggested QA steps for a local wiki or patch demo (cannot use beta wikis for this ticket, as the changes specifically should only apply to wikis other than beta wiki):

  1. Do either of the following, depending on what wiki you are using to test:
    1. If using a local wiki, do the following, enable temporary accounts by defining $wgAutoCreateTempUser['enabled'] = true; and remove any other definitions of $wgAutoCreateTempUser in your LocalSettings.php
    2. If using patch demo, make sure to enable temporary accounts
  2. Make edit while logged out, which should cause the creation of a temporary account username
  3. Verify that the format of the username starts with the current year, followed by a -, and then ends with a number.
  4. Go to the history page and verify that the username is surrounded in the grey background used to indicate that an account is a temporary account

I have verified the new code has been implemented and is functioning and displaying as expected... Thank You @Dreamy_Jazz!!!

image.png (390×1 px, 231 KB)

image.png (553×1 px, 372 KB)

image.png (866×718 px, 133 KB)

image.png (678×903 px, 255 KB)

image.png (879×436 px, 203 KB)

image.png (405×881 px, 187 KB)