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
- A service exists that returns data in a JSON serializable format for use in T386434: UserInfoCard: Add API endpoint in CheckUser extension