Page MenuHomePhabricator

Move code that groups and sorts the rows from the CheckUser result tables to the CheckUserLookupUtils service to reduce duplication
Closed, DeclinedPublic2 Estimated Story Points

Description

There exists code in the AbstractCheckUserPager that combines the rows from the three result tables, groups these rows, sorts these rows, and then truncates to the limit. This code will be duplicated in Special:Investigate related code, so moving this to service will help reduce duplication and make testing easier.

It should be possible to move the code in AbstractCheckUserPager::groupResultsByIndexField and some of AbstractCheckUserPager::reallyDoQuery into the service for use by Special:Investigate in T347102. However, this code needs to be updated to support grouping by multiple fields so this will involve more than just moving existing code to a service. Doing this will be useful to make T360712 easier to achieve.

Event Timeline

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

[mediawiki/extensions/CheckUser@master] Add common grouping and sorting methods to CheckUserLookupUtils

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

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

[mediawiki/extensions/CheckUser@master] [WIP] Use LookupUtils for grouping and sorting rows in CheckUser API

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

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

[mediawiki/extensions/CheckUser@master] [WIP] Use LookupUtils for grouping and sorting rows in Special:CheckUser

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

Dreamy_Jazz renamed this task from Move common grouping and sorting code to the CheckUserLookupUtils service to Move code that groups and sorts the rows from the CheckUser result tables to the CheckUserLookupUtils service to reduce duplication.Apr 24 2024, 6:51 PM
Dreamy_Jazz set the point value for this task to 2.

Change #1023890 abandoned by Dreamy Jazz:

[mediawiki/extensions/CheckUser@master] Add common grouping and sorting methods to CheckUserLookupUtils

Reason:

Going with a different method.

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

We don't need this for Special:Investigate 'Timeline' mode anymore, so this can be declined. The patches can be restored if necessary for T360712.

Change #1023900 abandoned by Dreamy Jazz:

[mediawiki/extensions/CheckUser@master] Use CheckUserLookupUtils for grouping and sorting rows in Special:CheckUser

Reason:

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

Change #1023899 abandoned by Dreamy Jazz:

[mediawiki/extensions/CheckUser@master] Use CheckUserLookupUtils for grouping and sorting rows in CheckUser API

Reason:

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