Page MenuHomePhabricator

Update reassignEdits.php to prevent reassignment of edits to IP addresses when temporary accounts are enabled
Closed, ResolvedPublic

Description

The reassignEdits.php maintenance script is used to update the performer of all edits by a given user to a different account and potentially IP address.

The script could be run with reassignEdits.php ~2024-01 1.2.3.4 --force which would reassign the edits made by a temporary account to an IP address. This would fail because actor IDs cannot be acquired for IP addresses. A more intuitive error message could be used to make it clear why the reassignment cannot happen.

Event Timeline

If this query is correct, then reassignEdits.php hasn't been used in WMF production, so I don't think this blocks any deployments.

This should not block any deployments, but is something that should probably be updated for the sake of ensuring core works with temporary accounts (even with strange use-cases).

The script (as it stands) would likely break several things in WMF production (e.g. the rows in CheckUser are not updated when the reassignment of the edits occurs), so I doubt that it will ever be run there unless fixed up.

Having discussed with @Reedy at the Hackathon, it seems better to just disable the ability to re-assign edits to an IP address. This is because the script currently doesn't work for changes to ip_changes (it only supports removing these rows and not updating them).

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

[mediawiki/core@master] Test reassignEdits.php and update it for temporary accounts

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

Change #1140706 merged by jenkins-bot:

[mediawiki/core@master] Test reassignEdits.php and update it for temporary accounts

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

Djackson-ctr subscribed.

QA is completed, I have verified the new code has been implemented and is functioning as expected (ReassignEdits.php: now prevents reassignment of edits to IP addresses when temporary accounts are enabled, also the error message has been updated to make it clear to the user the reason why the reassignment cannot happen).