Page MenuHomePhabricator

Add user agent ID column to each CheckUser result table
Closed, ResolvedPublic2 Estimated Story Points

Description

A column needs to be added to every CheckUser result table so that it can store the associated user agent string in the cu_useragent table.

The column will be named agent_id with the column prefix for the table appended to the name. For example, for the cu_changes table the column name would be cuc_agent_id. The column will be a bigint to be the same type as the cuua_id column in the cu_useragent table.

Acceptance criteria
  • Create the column in each of the cu_changes, cu_log_event, and cu_private_event tables.
Proposed schema
> describe cu_changes;
+----------------+---------------------+------+-----+---------+----------------+
| Field          | Type                | Null | Key | Default | Extra          |
+----------------+---------------------+------+-----+---------+----------------+
....
| cuc_agent_id   | bigint(20) unsigned | NO   |     | 0       |                |
+----------------+---------------------+------+-----+---------+----------------+

> describe cu_log_event;
+----------------+---------------------+------+-----+---------+----------------+
| Field          | Type                | Null | Key | Default | Extra          |
+----------------+---------------------+------+-----+---------+----------------+
....
| cule_agent_id  | bigint(20) unsigned | NO   |     | 0       |                |
+----------------+---------------------+------+-----+---------+----------------+

> describe cu_private_event;
+----------------+---------------------+------+-----+---------+----------------+
| Field          | Type                | Null | Key | Default | Extra          |
+----------------+---------------------+------+-----+---------+----------------+
....
| cupe_agent_id  | bigint(20) unsigned | NO   |     | 0       |                |
+----------------+---------------------+------+-----+---------+----------------+

Related Objects

StatusSubtypeAssignedTask
OpenFeatureNone
OpenFeatureNone
Resolved TBolliger
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedDreamy_Jazz
ResolvedDreamy_Jazz
ResolvedMarostegui
OpenNone
ResolvedMarostegui

Event Timeline

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

[mediawiki/extensions/CheckUser@master] Add cu_changes.cuc_agent_id

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

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

[mediawiki/extensions/CheckUser@master] Add cule_agent_id to cu_log_event table

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

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

[mediawiki/extensions/CheckUser@master] Add cupe_agent_id to cu_private_event

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

Dreamy_Jazz renamed this task from Add user agent ID column to each CheckUser result table that references the cu_useragent table to Add user agent ID column to each CheckUser result table.Mar 27 2024, 11:27 PM
Dreamy_Jazz updated the task description. (Show Details)
Dreamy_Jazz updated the task description. (Show Details)

Change #1015147 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Add cuc_agent_id to cu_changes table

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

Change #1015148 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Add cule_agent_id to cu_log_event table

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

Change #1015149 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Add cupe_agent_id to cu_private_event

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

Tchanders subscribed.

I think we can bypass QA since these aren't being written to yet. (I did some basic regression testing just in case.)

Moving back since this was already moved to QA (I had an old tab open when I moved this to Done).

Suggested QA steps for a local wiki:

  1. Run update.php
  2. Open the DB for your wiki
  3. If using MariaDB run describe table; or for SQLite use .schema table. Repeat this command three times, replacing table with cu_changes, then cu_log_event, finally cu_private_event
  4. Inspect the output of the commands and verify that the cuc_agent_id, cule_agent_id, cupe_agent_id column exists in the table cu_changes, cu_log_event, and cu_private_event respectively (i.e. cuc_agent_id should be in cu_changes).
dom_walden subscribed.

I have checked that column exists on MariaDB and SQLite3.