⚓ T355367 userOptions.php: Add support for --delete-defaults
Page MenuHomePhabricator

userOptions.php: Add support for --delete-defaults
Closed, ResolvedPublic

Description

As part of T353225: Echo: Make use of conditional user defaults, I need to delete entries from user_properties that match their current (conditional) default. While it is possible to delete such rows by doing something like mwscript userOptions.php --wiki=enwiki --delete --old 1 --fromuserid=906 --nowarn 'echo-subscriptions-web-article-linked', this has a couple of issues:

  • it is incredibly easy to mess up,
  • it is impossible to run via foreachwiki, because --fromuserid is specific for each wiki (based on the cutoff date from the conditional defaults config and the lowest ID among users who registered after that date)

To resolve those issues, we need something like mwscript userOptions.php --wiki=enwiki --delete-defaults 'echo-subscriptions-web-article-linked'.

Event Timeline

Urbanecm_WMF raised the priority of this task from High to Needs Triage.Jan 26 2024, 1:16 PM
Urbanecm_WMF moved this task from Inbox to Triaged on the Growth-Team board.

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

[mediawiki/core@master] userOptions: Add support for --delete-defaults

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

Urbanecm_WMF triaged this task as High priority.

I can't get the script I mentioned above to delete the right rows. Let's add --delete-defaults into the game.

Change 995028 merged by jenkins-bot:

[mediawiki/core@master] userOptions: Add support for --delete-defaults

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