Page MenuHomePhabricator

CheckUser: Add user_id and log_actor in testLogDatabaseRowsForHiddenUser
Closed, ResolvedPublic

Description

The test for CheckUserPrivateEventLogFormatterTest::testLogDatabaseRowsForHiddenUser has the log row expandDatabaseRow() with only the target user name.

In this test, the row represents an event performed by the hidden target user. The test creates target user, hides it, and then expects CheckUserPrivateEventLogFormatter to suppress the target user name. Not setting the user and log_actor in the function makes expandDatabaseRow() fallback to different actor different from the actor row in the test database.

Today the formatter checks the hidden database user and returns the expected suppressed name but changing User::load() function to leverage ActorStore as per task https://phabricator.wikimedia.org/T428517 produce a mismatch, two different users with the same name:

ActorStore: id=0, actorId=24, hidden=false
SELECT actor: id=1, actorId=1, hidden=true 

ActorStore:
  userId: 0
  actorId: 24
  name: "TestUser MediaWikiIntegrationTestCase 963954.001"

SELECT actor:
  userId: 1
  actorId: 1
  name: "TestUser MediaWikiIntegrationTestCase 963954.001"

Event Timeline

Change #1335086 had a related patch set uploaded (by Milazg; author: Milazg):

[mediawiki/extensions/CheckUser@master] Test: Add user_id and log_actor in testLogDatabaseRowsForHiddenUser

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

Change #1335086 had a related patch set uploaded (by Milazg; author: Milazg):

[mediawiki/extensions/CheckUser@master] Test: Add user_id and actor in testLogDatabaseRowsForHiddenUser

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

Change #1335754 had a related patch set uploaded (by Krinkle; author: Milazg):

[mediawiki/extensions/CheckUser@wmf/1.47.0-wmf.18] tests: Add user_id and actor in testLogDatabaseRowsForHiddenUser

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

Change #1335086 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] tests: Add user_id and actor in testLogDatabaseRowsForHiddenUser

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

Change #1335754 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@wmf/1.47.0-wmf.18] tests: Add user_id and actor in testLogDatabaseRowsForHiddenUser

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

Mentioned in SAL (#wikimedia-operations) [2026-09-07T13:59:48Z] <krinkle@deploy1003> Started scap sync-world: Backport for [[gerrit:1335754|tests: Add user_id and actor in testLogDatabaseRowsForHiddenUser (T436971)]], [[gerrit:1336613|User: Use ActorStore on User::load (T428517)]], [[gerrit:rEVED13357529e57a|Fix empty bases in m(under|over) (T436876)]], [[gerrit:1336611|Use Core-compatible output for cancellation (T379359)]], [[gerrit:1336609|Page: Fix absence caching when combined with mult

Mentioned in SAL (#wikimedia-operations) [2026-09-07T14:04:06Z] <krinkle@deploy1003> krinkle: Backport for [[gerrit:1335754|tests: Add user_id and actor in testLogDatabaseRowsForHiddenUser (T436971)]], [[gerrit:1336613|User: Use ActorStore on User::load (T428517)]], [[gerrit:rEVED13357529e57a|Fix empty bases in m(under|over) (T436876)]], [[gerrit:1336611|Use Core-compatible output for cancellation (T379359)]], [[gerrit:1336609|Page: Fix absence caching when combined with multiple properties

Mentioned in SAL (#wikimedia-operations) [2026-09-07T14:11:43Z] <krinkle@deploy1003> Finished scap sync-world: Backport for [[gerrit:1335754|tests: Add user_id and actor in testLogDatabaseRowsForHiddenUser (T436971)]], [[gerrit:1336613|User: Use ActorStore on User::load (T428517)]], [[gerrit:rEVED13357529e57a|Fix empty bases in m(under|over) (T436876)]], [[gerrit:1336611|Use Core-compatible output for cancellation (T379359)]], [[gerrit:1336609|Page: Fix absence caching when combined with mul