Page MenuHomePhabricator

UserInfoCard: Create service to return user info card data for an account
Closed, ResolvedPublic

Description

Summary

Create a service, CheckUserUserInfoCardService, that will return data for a user account for use in T384725: [Epic] WE4.2.18 UserInfoCard experiment for assisting patrollers and moderators.

Background

The user info card will load data from an API endpoint T386434: UserInfoCard: Add API endpoint in CheckUser extension. The API endpoint should get its data from the CheckUserUserInfoCardService that we will create in this task.

User story

As a developer, I need a service for encapsulating the logic used in returning data points used in T384725: [Epic] WE4.2.18 UserInfoCard experiment for assisting patrollers and moderators.

Technical notes

  • GrowthExperiments has a service and an API for user impact that has some data needed for the UserInfoCard (e.g. edit activity in last 60 days, number of thanks received). The CheckUserUserInfoCardService service should reuse what is available from the GrowthExperiments User Impact API. We could also look at adding in additional data points to the GrowthExperiments user impact data store, either via a hook (which we'd need to add) or just hardcoding it in the GrowthExperiments extension. In previous discussions with Growth team, we had approval to add more data points to the impact module data store directly in GrowthExperiments, so long as we don't negatively impact performance.
      • If we can't add to the Growth impact data store directly, then everything else can be calculated on the fly, and performance tuning can happen at a later point in time. (For example, some of the data points we calculate could be moved into the GrowthExperiments User Impact API which has a robust caching mechanism.)
    • Alternatively, we could consider a short-lived caching mechanism and/or cache invalidation on block change, on edit, etc. This may need a separate task.
  • We should aim for <100ms timings when returning data

Acceptance criteria

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
KColeman-WMF renamed this task from UserReputationCard: Create service to return reputation data for an account to UserInfoCard: Create service to return reputation data for an account.Mar 12 2025, 3:04 PM
KColeman-WMF updated the task description. (Show Details)

Change #1128447 had a related patch set uploaded (by STran; author: STran):

[mediawiki/extensions/CheckUser@master] [WIP] Add CheckUserUserReputationService

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

kostajh renamed this task from UserInfoCard: Create service to return reputation data for an account to UserInfoCard: Create service to return user info card data for an account.Mar 21 2025, 11:41 AM
kostajh updated the task description. (Show Details)

Change #1130132 had a related patch set uploaded (by STran; author: STran):

[integration/config@master] Zuul: [mediawiki/extensions/CheckUser] Add GrowthExperiments dependency

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

Change #1130132 merged by jenkins-bot:

[integration/config@master] Zuul: [mediawiki/extensions/CheckUser] Add GrowthExperiments dependency

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

Mentioned in SAL (#wikimedia-releng) [2025-03-23T18:31:48Z] <James_F> Zuul: [mediawiki/extensions/CheckUser] Add GrowthExperiments dependency, for T386435

Change #1128447 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] UserInfoCard: Add CheckUserUserInfoCardService

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

I think this can skip QA, and we can do QA on individual subtasks of the epic.

Change #1141453 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/CheckUser@master] UserInfoCard: Return early if user impact data doesn't exist

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

Change #1141453 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] UserInfoCard: Return early if user impact data doesn't exist

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

Change #1160160 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/CheckUser@master] UserInfoCard: Improved handling when GrowthExperiments isn't installed

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

Change #1160160 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] UserInfoCard: Improved handling when GrowthExperiments isn't installed

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