Page MenuHomePhabricator

Create and run a maintenance script to rename incorrectly capitalised Nuke-tagged log entries [2HRS]
Closed, ResolvedPublic

Description

Per the comments in T379168, we inadvertently created the Nuke tag as Nuke instead of nuke. We fixed this, but it means that there are some log entries with the incorrect capitalisation.

We could create a maintenance script to run through and rename these.

Acceptance criteria:

  • create the script
  • run the script in production

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

There is renameChangeTag.php is the WikimediaMaintenance extension, maybe that fit your needs here.

There is renameChangeTag.php is the WikimediaMaintenance extension, maybe that fit your needs here.

It does not merge the entries in change_tag_def (addition of ctd_count?) and does not update ct_tag_id in change_tag after the merge to the new ctd_id (in batches to be db friendly).
So this does not help. Maybe the script can be used as start point or it gets expanded, when this fix is only needed for wmf wikis and not for third party wikis.

So what is needed is a maintenance script to merge a change tag to another. (this may be a feature in core; it is not Wikimedia specific)

Chlod subscribed.

Discussed this at Wikimedia-Hackathon-2025 with Zabe and Dreamy Jazz. They're suggesting that this be an addition to update.php runs so that this can also fix local (test) installations or anything that pulls from the repo at an interval. The period that the extension was using Nuke was quite long, unlike "around three hours or something" where it would probably just be enough to put whatever script into WikimediaMaintenance.

Change #1152393 had a related patch set uploaded (by Chlod Alejandro; author: Chlod Alejandro):

[mediawiki/extensions/Nuke@master] Add maintenance script to recapitalize 'Nuke' tags

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

Discussed this at Wikimedia-Hackathon-2025 with Zabe and Dreamy Jazz. They're suggesting that this be an addition to update.php runs so that this can also fix local (test) installations or anything that pulls from the repo at an interval. The period that the extension was using Nuke was quite long, unlike "around three hours or something" where it would probably just be enough to put whatever script into WikimediaMaintenance.

putting it in update.php would not resolve the issue in production since prod data migration work is generally not handled that way so far as I know. I recommend a discrete maintenance script and requesting a look from a DBA from SRE.

Discussed this at Wikimedia-Hackathon-2025 with Zabe and Dreamy Jazz. They're suggesting that this be an addition to update.php runs so that this can also fix local (test) installations or anything that pulls from the repo at an interval. The period that the extension was using Nuke was quite long, unlike "around three hours or something" where it would probably just be enough to put whatever script into WikimediaMaintenance.

putting it in update.php would not resolve the issue in production since prod data migration work is generally not handled that way so far as I know. I recommend a discrete maintenance script and requesting a look from a DBA from SRE.

update.php itself isn't directly ran on Wikimedia production; that's primarily for third-party wikis. To my recollection, in production, any sort of schema/data update script is ran directly with the relevant class (in this case, NormalizeNukeTags). NormalizeNukeTags itself is already a maintenance script (cf. RUN_MAINTENANCE_IF_MAIN at the bottom of that file); it just gets executed as part of update.php so that it doesn't have to be manually run by any other wiki using Nuke.

I'm not Chlod, but it seems like the patch is ready for review — to resolve the issue on production, it seems like the proposed normalizeNukeTags.php can just be ran as a maintenance script in itself.

Thanks, @A_smart_kitten! I'm currently out on vacation so I couldn't reply. But yep, that's right on the money. If the patch is good, it can be merged, and a maintenance task run would have to be scheduled and subsequently ran by someone with production access.

Change #1152393 merged by jenkins-bot:

[mediawiki/extensions/Nuke@master] Add maintenance script to recapitalize 'Nuke' tags

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

jsn.sherman renamed this task from Create and run a maintenance script to rename incorrectly capitalised Nuke-tagged log entries to Create and run a maintenance script to rename incorrectly capitalised Nuke-tagged log entries [2HRS].Aug 5 2025, 4:19 PM
Chlod added subscribers: Ladsgroup, Reedy.

Talked to @Reedy and @Ladsgroup about this and either can run the maintenance script during the Hackathon this week.

Change #1176225 had a related patch set uploaded (by Chlod Alejandro; author: Chlod Alejandro):

[mediawiki/extensions/Nuke@wmf/1.45.0-wmf.12] Add maintenance script to recapitalize 'Nuke' tags

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

Change #1176225 merged by jenkins-bot:

[mediawiki/extensions/Nuke@wmf/1.45.0-wmf.12] Add maintenance script to recapitalize 'Nuke' tags

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

Mentioned in SAL (#wikimedia-operations) [2025-08-06T12:56:52Z] <reedy@deploy1003> Started scap sync-world: Backport for [[gerrit:1176225|Add maintenance script to recapitalize 'Nuke' tags (T381598)]]

Mentioned in SAL (#wikimedia-operations) [2025-08-06T12:58:44Z] <reedy@deploy1003> chlod, reedy: Backport for [[gerrit:1176225|Add maintenance script to recapitalize 'Nuke' tags (T381598)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-08-06T13:05:11Z] <reedy@deploy1003> Finished scap sync-world: Backport for [[gerrit:1176225|Add maintenance script to recapitalize 'Nuke' tags (T381598)]] (duration: 08m 18s)

Mentioned in SAL (#wikimedia-operations) [2025-08-06T13:11:44Z] <Reedy> ran foreachwiki extensions/Nuke/maintenance/normalizeNukeTags.php T381598