Page MenuHomePhabricator

Create a maintenance script used only for testing to insert a large volume of testing actions to CheckUser
Closed, ResolvedPublic

Description

One issue with CheckUser is that issues crop up when the extension encounters a DB with a large number of edits and actions. This cannot adequately done in CI tests as the setup time would add too much time to set-up each test. However, having a instance of CheckUser that has a DB filled with varying actions means that in code review and QA the extension can be tested against an environment that isn't usually present on a local testing wiki.

Acceptance criteria
  • Create a maintenance script used only for testing that adequately fills the DB with events in CheckUser

QA Results - Local

Related Objects

StatusSubtypeAssignedTask
ResolvedFeatureDreamy_Jazz
ResolvedFeatureDreamy_Jazz
OpenNone
ResolvedSecurityDreamy_Jazz
ResolvedSecurityZabe
ResolvedSecurityDreamy_Jazz
ResolvedSecurityDreamy_Jazz
ResolvedSecurityDreamy_Jazz
ResolvedBUG REPORTDreamy_Jazz
ResolvedBUG REPORTDreamy_Jazz
ResolvedBUG REPORTDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedNone
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedFeatureDreamy_Jazz
DuplicateNone
ResolvedFeatureDreamy_Jazz
ResolvedFeatureDreamy_Jazz
ResolvedFeatureDreamy_Jazz
ResolvedFeatureDreamy_Jazz
ResolvedFeatureDreamy_Jazz
ResolvedBUG REPORTDreamy_Jazz
DeclinedFeatureNone
ResolvedFeatureDreamy_Jazz
ResolvedGlaisher
ResolvedFeatureDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedFeatureDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
DeclinedNone
ResolvedFeatureDreamy_Jazz
ResolvedGlaisher
ResolvedNiharika
ResolvedNone
ResolvedFeatureDreamy_Jazz
DeclinedNone
ResolvedFeatureDreamy_Jazz
ResolvedFeatureDreamy_Jazz
DuplicateNone
ResolvedDreamy_Jazz
DuplicateNone
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
OpenFeatureNone
ResolvedDreamy_Jazz
ResolvedBUG REPORTDreamy_Jazz
ResolvedBUG REPORTDreamy_Jazz
OpenNone
OpenFeatureNone
DeclinedFeatureNone
OpenFeatureNone
ResolvedDreamy_Jazz
Resolvedkostajh
Resolvedkostajh
ResolvedNone
Resolvedtstarling
ResolvedTchanders
DeclinedBUG REPORTNone
OpenNone
OpenNone
ResolvedDreamy_Jazz
ResolvedFeatureDreamy_Jazz
ResolvedDreamy_Jazz

Event Timeline

Dreamy_Jazz renamed this task from Create a test helper to insert a large volume of testing edits to CheckUser for testing to Create a maintenance script used only for testing to insert a large volume of testing actions to CheckUser.Jul 20 2023, 5:11 PM

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

[mediawiki/extensions/CheckUser@master] [WIP] Create a maintenance script to populate tables with test data

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

I think this is ready for code review. Happy to discuss and help testing this.

Change 947900 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Create a maintenance script to populate tables with test data

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

The steps to QA test this are maybe not as clear-cut as other tasks, but I would suggest the following steps. The maintenance script will create users and make edits, so don't do this on a wiki where you don't want this to happen:

  • Enable wgCheckUserDeveloperMode by setting it to true
  • Enable temporary account creation
  • Run the maintenance script added by this task. You can use docker compose exec mediawiki php maintenance/run.php CheckUser:populateCheckUserTablesWithSimulatedData.php to run the script
  • Ensure the script runs without errors (it should output usernames, temporary account names and then IPs)
  • Load Special:CheckUser and/or Special:Investigate
  • Run a check on 127.0.0.1/24
  • Verify that actions exist from multiple users, temporary accounts and IPs within the range 127.0.0.1/24.

Further QA testing could be performed, but as this maintenance script is designed for use to set-up a local testing wiki doing in-depth QA testing may not be necessary.

@Dreamy_Jazz After running the script, I see in Special:Log a few entries:

<user> performed unknown action "delete/suppress" on <page>

These log entries still appear in Special:Investigate and Special:CheckUser, so perhaps it does not matter.

@Dreamy_Jazz After running the script, I see in Special:Log a few entries:

<user> performed unknown action "delete/suppress" on <page>

These log entries still appear in Special:Investigate and Special:CheckUser, so perhaps it does not matter.

I had noticed this after the merge. I will fix the script. I can also write something to remove these incorrect logs if wanted.

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

[mediawiki/extensions/CheckUser@master] Fix use of 'suppress' log type in simulated data maintenance script

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

GMikesell-WMF subscribed.

@Dreamy_Jazz No errors when the script ran and verified that actions exist from multiple users, temporary accounts and IPs are within the range 127.0.0.1/24. I will move this to Done. Also, I will update this task with the task for <user> performed unknown action "delete/suppress" on <page> when you have created it. Thanks for all your work!

Update: https://phabricator.wikimedia.org/T346105

Status: ✅ PASS
Environment: Local 1.41.0-alpha (2f2802e) 20:03, 11 September 2023. CheckUser: 2.5 (7402d99) 13:46, 11 September 2023
OS: macOS Ventura
Browser: Chrome 116
Device: MBP
Emulated Device:: N/A
Test Links:
Special:Investigate
Special:CheckUser

✅AC1: https://phabricator.wikimedia.org/T342371#9128336

Special:InvestigateSpecial:CheckUser
2023-09-11_12-10-46.png (1×2 px, 642 KB)
2023-09-11_09-18-29.png (1×3 px, 856 KB)

Change 954325 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Fix use of 'suppress' log type in simulated data maintenance script

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