Page MenuHomePhabricator

purgeOldData.php should report deletion of orphaned client hints data in a separate line
Closed, ResolvedPublic1 Estimated Story PointsBUG REPORT

Description

In T350681: Update purgeOldData.php maintenance script to look for and delete orphaned map rows code was added to purge orphaned client hints data which is then called by the purgeOldData.php maintenance script.

When using the purgeOldData.php maintenance script a call to UserAgentClientHintsManager::deleteOrphanedMapRows is made inside the prune method of the maintenance script. This method is called for all three CheckUser result tables (cu_changes, cu_log_event, and cu_private_event) as well as recentchanges.

However:

  • The call to UserAgentClientHintsManager::deleteOrphanedMapRows is made when purging recentchanges entries, which is incorrect
  • UserAgentClientHintsManager::deleteOrphanedMapRows purges data from all three of the CheckUser result tables instead of purging from a specific table.

Instead, the UserAgentClientHintsManager::deleteOrphanedMapRows call should be made outside the prune method and the result printed to the console separately. Otherwise the purged counts will be off.

Event Timeline

Dreamy_Jazz renamed this task from purgeOldData.php incorrectly prints deletion of orphaned client hints data to purgeOldData.php should report deletion of orphaned client hints data in a separate line.Jan 9 2024, 3:26 PM
Dreamy_Jazz updated the task description. (Show Details)

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

[mediawiki/extensions/CheckUser@master] Make purgeOldData.php report number from ::deleteOrphanedMapRows seperately

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

Change 989976 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Make purgeOldData.php report result of ::deleteOrphanedMapRows separately

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

Suggested QA steps for a local environment:

  1. Install the CheckUser extension (if required)
  2. Run the ./maintenance/run CheckUser:purgeOldData.php
  3. Verify that at the end of the output the following text is present, where X is a positive integer or 0:
Purged X orphaned client hint mapping rows.