Page MenuHomePhabricator

ChangesListQuery class and related ChangesListSpecialPage refactoring
Open, Needs TriagePublic

Description

In order to make it feasible to implement performance improvements like rc_source condition merging (T403142) and the subquery required for T403798, I plan to make the following changes to ChangesListSpecialPage:

  • Factor out ChangesListFilterGroupContainer, which will handle iteration over defined filter groups and filters.
  • Factor out ChangesListFilterFactory, which will handle registration of filter group definitions and construction of ChangesListFilterGroup objects.
  • Add a class called ChangesListQuery which will present a more abstracted view of query building, replacing the current system of query info arrays passed by reference.
  • Migrate core and extension filters to the ChangesListQuery system.
  • Migrate extensions which handle the ChangesListSpecialPageQuery hook to a new hook which will take a ChangesListQuery.

Event Timeline

Change #1186678 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] recentchanges: Add ChangesListFilterGroupContainer

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

Change #1188507 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] recentchanges: Add ChangesListFilterFactory

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

Change #1188511 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/extensions/Wikibase@master] In ChangesListSpecialPageHookHandlerTest avoid protected property access

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

Change #1188511 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] In ChangesListSpecialPageHookHandlerTest avoid protected property access

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

Change #1186678 merged by jenkins-bot:

[mediawiki/core@master] recentchanges: Add ChangesListFilterGroupContainer

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

Change #1188507 merged by jenkins-bot:

[mediawiki/core@master] recentchanges: Add ChangesListFilterFactory

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

Change #1192119 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/skins/MinervaNeue@master] Fix minor Phan issue in FetchChangesList hook handler

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

Change #1191646 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] recentchanges: Add ChangesListQuery

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

Change #1192119 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Fix minor Phan issue in FetchChangesList hook handler

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

Test wiki created on Patch demo by KGraessle-WMF using patch(es) linked to this task:
https://206382c5a9.catalyst.wmcloud.org/w/

Hi @tstarling! I have found a couple of bugs while testing your changes in patch 1191646.

First of all, the highlighting is not working in any of the skins I tested it on (Vector 2022 (dark and light versions), Vector 2010, and Monobook). Also, if I select the Changes by you and Changes by others options and refresh the page, the checkboxes are no longer selected, but the chips in the Active Filters section still appear. The expected behavior is to have the checkboxes selected on refresh. Lastly, in the GIF below, you can see the highlight error and some odd behavior when selecting Changes by you. Every time I selected that checkbox, the filter box would close, and I would have to click outside the filter input to re-enable the filter box.

RC_Highlights.gif (354×640 px, 937 KB)

Finally, when clicking around the filters, I got a Database error. These are the URL parameters of the broken query: ?goodfaith=likelybad%3Bverylikelybad&userExpLevel=unregistered%3Bregistered&hidebots=1&reviewStatus=unpatrolled%3Bmanual&hidecategorization=1&namespace=12%3B15%3B92&tagfilter=mw-new-redirect|discussiontools-newtopic|nuke|pagetriage&limit=500&days=30&urlversion=2

Screenshot 2025-10-07 at 12.21.07.png (740×1 px, 330 KB)

First of all, the highlighting is not working in any of the skins I tested it on (Vector 2022 (dark and light versions), Vector 2010, and Monobook).

Should be fixed in PS13.

Also, if I select the Changes by you and Changes by others options and refresh the page, the checkboxes are no longer selected, but the chips in the Active Filters section still appear. The expected behavior is to have the checkboxes selected on refresh.

I can reproduce that against master and in production, and I haven't touched that code, so I don't think it is related.

Lastly, in the GIF below, you can see the highlight error and some odd behavior when selecting Changes by you. Every time I selected that checkbox, the filter box would close, and I would have to click outside the filter input to re-enable the filter box.

I can't reproduce that in either my version or master or on the patchdemo, but it is probably not related to my change since I haven't touched the relevant code.

Finally, when clicking around the filters, I got a Database error. These are the URL parameters of the broken query: ?goodfaith=likelybad%3Bverylikelybad&userExpLevel=unregistered%3Bregistered&hidebots=1&reviewStatus=unpatrolled%3Bmanual&hidecategorization=1&namespace=12%3B15%3B92&tagfilter=mw-new-redirect|discussiontools-newtopic|nuke|pagetriage&limit=500&days=30&urlversion=2

This is reproducible against master but requires SQL "strict mode" which is not enabled in production. It's also reproducible if I revert my recent work 962e5dd1, 9126b7c6 and 5318213a. It's reproducible by simply selecting any two change tags. It indicates that this feature will fail on PostgreSQL, which is similar to MySQL's strict mode. I filed T406676 for this.

Change #1194338 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] recentchanges: Migrate RecentChangesLinked to the new system

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

Change #1194560 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] recentchanges: Migrate change tags to the new system

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

Test wiki on Patch demo by KGraessle-WMF using patch(es) linked to this task was deleted:

https://206382c5a9.catalyst.wmcloud.org/w/

Test wiki created on Patch demo by KGraessle-WMF using patch(es) linked to this task:
https://04607422ab.catalyst.wmcloud.org/w/

Hi, I'm currently reviewing: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1191646

and I'm seeing some issues with the highlighter when grouping is enabled on patch demo:

Screenshot 2025-10-09 at 12.29.22 PM.png (697×2 px, 270 KB)

Another issue I'm seeing is with the ORES filters. If you filter by the new revert risk filter with records that should come back you see nothing:

Screenshot 2025-10-09 at 12.37.46 PM.png (839×1 px, 59 KB)

(note this is testing locally and not on patch demo due to limitations with setting it up on patch demo)

Test wiki on Patch demo by KGraessle-WMF using patch(es) linked to this task was deleted:

https://04607422ab.catalyst.wmcloud.org/w/

Test wiki created on Patch demo by KGraessle-WMF using patch(es) linked to this task:
https://0fbfb38dfc.catalyst.wmcloud.org/w/

Test wiki on Patch demo by KGraessle-WMF using patch(es) linked to this task was deleted:

https://0fbfb38dfc.catalyst.wmcloud.org/w/

Test wiki created on Patch demo by KGraessle-WMF using patch(es) linked to this task:
https://5f215c17d3.catalyst.wmcloud.org/w/

Change #1191646 merged by Scardenasmolinar:

[mediawiki/core@master] recentchanges: Add ChangesListQuery

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

Test wiki on Patch demo by KGraessle-WMF using patch(es) linked to this task was deleted:

https://5f215c17d3.catalyst.wmcloud.org/w/

Test wiki created on Patch demo by KGraessle-WMF using patch(es) linked to this task:
https://156319ceb5.catalyst.wmcloud.org/w/

Test wiki created on Patch demo by KGraessle-WMF using patch(es) linked to this task:
https://83ddfa3b42.catalyst.wmcloud.org/w/

Test wiki on Patch demo by KGraessle-WMF using patch(es) linked to this task was deleted:

https://156319ceb5.catalyst.wmcloud.org/w/

Test wiki on Patch demo by KGraessle-WMF using patch(es) linked to this task was deleted:

https://83ddfa3b42.catalyst.wmcloud.org/w/

Test wiki created on Patch demo by KGraessle-WMF using patch(es) linked to this task:
https://d936f15c39.catalyst.wmcloud.org/w/

Change #1194338 merged by jenkins-bot:

[mediawiki/core@master] recentchanges: Migrate RecentChangesLinked to the new system

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

Change #1194560 merged by jenkins-bot:

[mediawiki/core@master] recentchanges: Migrate change tags to the new system

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

Test wiki on Patch demo by KGraessle-WMF using patch(es) linked to this task was deleted:

https://d936f15c39.catalyst.wmcloud.org/w/

Hi, I noticed one issue on testwiki this morning.

Some of the highlighters aren't working:

Translate filter:

Screenshot 2025-10-22 at 8.50.48 AM.png (1×965 px, 240 KB)

User registration filter:

Screenshot 2025-10-22 at 9.04.11 AM.png (939×953 px, 240 KB)

Change #1199523 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/extensions/Translate@master] Fix broken RC translation highlight

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

Change #1199527 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] recentchanges: Fix experience=registered highlight

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

Translate filter:

This was broken since 2023, but I fixed it anyway in 1199523.

User registration filter:

This one was my fault, and I fixed it in 1199527.

Change #1199523 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Fix broken RC translation highlight

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

Change #1199527 merged by jenkins-bot:

[mediawiki/core@master] recentchanges: Fix experience=registered highlight

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

Change #1199797 had a related patch set uploaded (by Zabe; author: Tim Starling):

[mediawiki/core@REL1_45] recentchanges: Fix experience=registered highlight

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

Change #1199797 merged by jenkins-bot:

[mediawiki/core@REL1_45] recentchanges: Fix experience=registered highlight

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