Page MenuHomePhabricator

Make the cupe_private column nullable
Closed, ResolvedPublic2 Estimated Story Points

Description

As discussed in T353953: Don't use actor IDs for private CheckUser events when these actions are performed by IP addresses, IP addresses cannot acquire an actor ID when temporary accounts are enabled. However, we still need to associate certain private CheckUser events (such as failed login attempts) with an IP address performer.

To do this, it has been decided to make the cupe_actor column nullable. Using 0 was considered, but if a third-party wiki uses foreign key constraints, then using 0 would cause a constraint violation whereas NULL does not. I would also argue that using NULL is clearer than 0 from a non MediaWIki context.

Acceptance criteria
  • Modify the cupe_actor column to be nullable (a separate task will be filed to apply this change to WMF wikis at a later stage).

QA Results - VC

Event Timeline

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

[mediawiki/extensions/CheckUser@master] Make cu_private_event.cupe_actor nullable

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

Change 1010272 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Make cu_private_event.cupe_actor nullable

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

Suggested QA steps (can only be run on a local wiki, as beta wikis do not have CheckUser):

  1. Run update.php
  2. Connect to the database and run DESCRIBE cu_private_event if using mariadb. For SQLite you can use .schema cu_private_event or similar command.
  3. Verify that the cupe_actor column is listed there and that it can take NULL values. For example, on mariadb/mysql the Null column should have the value YES for the cupe_actor column as highlighted below:

image.png (901×1 px, 71 KB)

@Dreamy_Jazz cupe_actor is now nullable as seen in the screenshots below in SQLite. This will be moved to Done. Thanks for all your work and steps!

Status: ✅PASS
Environment: VC- commit 7e58353c50674d75ba928311a7c6af9f6e425c0b; CheckUser- commit 419521d6cd9fb6322d6e50fa0840da3d774efbba
OS: macOS Sonoma 14.4
Browser: Chrome 122
Skins. N/A
Device: MBA M2
Emulated Device:: n/a
Test Links:

✅AC1: https://phabricator.wikimedia.org/T359873

Previous PatchNew Patch
2024-03-19_07-49-55.png (509×1 px, 96 KB)
2024-03-18_18-12-44.png (548×779 px, 91 KB)