Page MenuHomePhabricator

Use expression builder instead of raw SQL in Wikistories
Closed, ResolvedPublic

Description

Now that T210206: Deprecate raw SQL conditions for IDatabase methods (select, insert, etc.) is done, this extension should migrate away from building and passing around raw SQL to expression builders.

It improves readability and security of the code and is more aligned with industry practices easing onboarding.

For more information check T210206 and T350075.

Calls to Database::addQuotes(), ::buildLike(), ::makeList() indicate that raw SQL is being built and passed around.

QA Results - Beta

Event Timeline

SBisson triaged this task as Medium priority.Nov 17 2023, 4:43 PM
SBisson added a project: Inuka-Team (Kanban).
SBisson moved this task from Backlog to Ready for Dev on the Inuka-Team (Kanban) board.

Change 977727 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/Wikistories@master] Replace raw SQL with exp function

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

Change 977727 merged by jenkins-bot:

[mediawiki/extensions/Wikistories@master] Replace raw SQL with expr function

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

Only small code maintenance to the filtering of Wikistories events on Special:RecentChanges. Should not change any behavior.

@SBisson I did not come across any issue when doing regression testing except the one I just filed right now in T353552: Wikistories: Duplicate content when selecting the images. I will move this to design sign-off since the new task has been created. Thanks for all your work!

Status: ✅PASS
Environment: Beta: 1.42.0-alpha (5a95e4e)
OS: macOS Sonoma 14.2
Browser: Chrome 120, Firefox 120, Safari 17.2, Edge 120
Skins. mobile
Device: MBA M2
Emulated Device:: BrowserStack: iPhone 12, iPad, Galaxy S23, Pixel 8 Pro, iPhone 8
Test Links:
https://en.m.wikipedia.beta.wmflabs.org/wiki/Harry_Potter

✅AC1: https://phabricator.wikimedia.org/T350956

No other issue except the one below which I filed on T353552: Wikistories: Duplicate content when selecting the images

I also filed T353567: WikiStories: Mobile Desktop- Text Size box for mobile desktop issue