Page MenuHomePhabricator

[S] Install PageTriage locally and investigate codebase
Closed, ResolvedPublic

Assigned To
Authored By
Samwalton9-WMF
Mar 17 2023, 11:24 AM
Referenced Files
F36923441: Screen Shot 2023-03-22 at 22.09.03.png
Mar 23 2023, 4:10 AM
F36923442: Screen Shot 2023-03-22 at 22.09.08.png
Mar 23 2023, 4:10 AM
F36923439: Screen Shot 2023-03-22 at 22.04.07.png
Mar 23 2023, 4:10 AM
F36923406: Screen Shot 2023-03-22 at 20.43.22.png
Mar 23 2023, 3:19 AM
F36923407: Screen Shot 2023-03-22 at 20.43.36.png
Mar 23 2023, 3:19 AM
F36923401: Screen Shot 2023-03-22 at 20.42.37.png
Mar 23 2023, 3:19 AM
F36923402: Screen Shot 2023-03-22 at 20.42.54.png
Mar 23 2023, 3:19 AM
F36922044: Screen Shot 2023-03-21 at 12.43.37.png
Mar 21 2023, 6:46 PM

Description

As part of our team's process for understanding what our priorities should be for PageTriage technical work, please set up the PageTriage extension locally and spend some time investigating the codebase.

Make notes of the kinds of things that are confusing to you, as you browse the code for the first time, and opportunities that you see for improving the extension to make it easier for you to maintain.

Feel free to use this ticket to make notes, or not. This is primarily a placeholder ticket to acknowledge the investigations we're doing.

Event Timeline

Scardenasmolinar changed the task status from Open to In Progress.Mar 21 2023, 5:11 PM
Scardenasmolinar moved this task from Ready to In Progress on the Moderator-Tools-Team (Kanban) board.

I cloned and added all configurations for PageTriage in the LocalSettings file. After that, I ran docker-compose exec mediawiki composer update and docker-compose exec mediawiki php maintenance/update.php. I created several new pages as an anonymous and logged-in user. They all appear in RecentChanges but none appear in Special:NewPagesFeed.

Screen Shot 2023-03-21 at 12.43.37.png (339×1 px, 51 KB)

Might check on the database to see if there are any entries in the database tables.

I see the tables in the database, but no information in them except for pagetriage_tags.

Comparing some Ajax requests between my local environment and en.wiki, I see that my local environment throws some warnings about unrecognized parameters and the date format is different. This might be the reason articles are not showing. I'll take a look at how dates are stored in articles to see if there is something there.

Local environment Ajax requests

Screen Shot 2023-03-22 at 20.42.54.png (278×1 px, 44 KB)

Screen Shot 2023-03-22 at 20.42.37.png (301×1 px, 63 KB)

English Wikipedia Ajax requests

Screen Shot 2023-03-22 at 20.43.36.png (302×890 px, 59 KB)

Screen Shot 2023-03-22 at 20.43.22.png (301×1 px, 74 KB)

I see that a Add to the New Pages Feed link has been added to the page toolbar on the right of my screen. I press it and it returns a success message. However, I still don't see the articles in Special:NewPagesFeed and there are no entries in the database.

Screen Shot 2023-03-22 at 22.04.07.png (54×162 px, 4 KB)

Screen Shot 2023-03-22 at 22.09.08.png (195×490 px, 18 KB)

Screen Shot 2023-03-22 at 22.09.03.png (234×524 px, 25 KB)

@kostajh Have you had this issue where no new pages are showing up in Special:NewPagesFeed in your local environment?

I have not. I think the easiest way to figure out what is going on is to use XDebug and set a breakpoint in extensions/PageTriage/includes/Hooks.php#onPageSaveComplete, then follow what's happening.

What does $wgPageTriageNamespaces look like in shell.php?

What does $wgPageTriageNamespaces look like in shell.php?

It's

$wgPageTriageNamespaces
= [
    0,
  ]

which I assume is NS_MAIN

After following @kostajh's advice to use MySQL instead of SQLite, I found the error that keeps data from being inserted into the pagetriage_page table:

Error: stepping, NOT NULL constraint failed: pagetriage_page.ptrp_tags_updated (19).

Will look further into it.

I filed T333389 to follow up on the SQLite error. A patch has been created that fixed it. With those changes, my local environment works so I will now move this task to Done.