Page MenuHomePhabricator

CleanupEmptyCategories should not be subclass of LoggedUpdateMaintenance
Open, LowPublic

Description

The cleanupEmptyCategories.php maintenance script is not meant to be a script to be run once in the entire lifetime of the wiki. However, its class extends LoggedUpdateMaintenance, causing it to do nothing when the script has been run once, which makes no sense.

See T167669#3561945 and Topic:V8te8titzif3wlc8

Event Timeline

Without using the --force parameter the output of the script is

...Update 'cleanup empty categories' already logged as completed.

in contrast to e.g.

Adding empty categories with description pages...
Removing empty categories without description pages...
--mode=remove --begin=Weinstube_im_Landkreis
Category cleanup complete.

Setup

  • MediaWiki 1.31.4 (171d96b) 30. Sep. 2019, 19:35
  • PHP 7.2.13-1+0~20181207100540.13+stretch~1.gbpf57305 (apache2handler)
  • MariaDB 10.1.37-MariaDB-0+deb9u1

Change 742547 had a related patch set uploaded (by RhinosF1; author: RhinosF1):

[mediawiki/core@master] CleanupEmptyCategories: use Maintenance class

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

RhinosF1 triaged this task as Low priority.
RhinosF1 added a project: User-RhinosF1.
RhinosF1 moved this task from Radar to Extensions & Core on the User-RhinosF1 board.

The script was added in https://github.com/wikimedia/mediawiki/commit/47e2ef34b0c3dbecfc80b84acad9d2bb0baac1e2 which first landed in 1.28.

I assume this would impact upgrades from 1.27 which we are still meant to support.

This technically won't break anything but could end up with some incorrect category entries that wouldn't sync up correctly if you're still on 1.27 and haven't upgraded yet.

Fixing this might be an annoyance for them people so if we want to keep things right then we'd probably have to wait until 1.39

Repeat my comment from the patch set, where I suggest not doing this.

The maintenance script is running as part of update.php and therefor should be a LoggedUpdateMaintenance. There is no need to run it on every update.php even for large wikis. If running from a job that should specify the force parameter.

Noting as above that it can be removed from update.php once 1.39 is cut.