Page MenuHomePhabricator

Use expression builder instead of raw SQL in TranslationNotifications
Closed, ResolvedPublic2 Estimated Story Points

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.

Event Timeline

Nikerabbit moved this task from Backlog to Maintenance on the TranslationNotifications board.

Change 992153 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/TranslationNotifications@master] Use expression builder to replace uses of addQuotes().

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

Change 992154 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/TranslationNotifications@master] Use Expression builder instead of raw SQL and deprecared methods

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

Change 992153 merged by jenkins-bot:

[mediawiki/extensions/TranslationNotifications@master] Use expression builder to replace uses of addQuotes().

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

Change 992154 merged by jenkins-bot:

[mediawiki/extensions/TranslationNotifications@master] Use Expression builder instead of raw SQL and deprecated methods

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

Wangombe changed the task status from Open to In Progress.Feb 15 2024, 7:43 AM
Wangombe claimed this task.
Wangombe set the point value for this task to 2.
abi_ subscribed.

Tested existing functionality on MediaWiki.org by sending a test translations to Odia translators. Nothing appears to be broken.

Change 1005643 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/TranslationNotifications@master] Replace usage of wfGetDB(). Use ConnectionProvider

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

Change #1032875 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/extensions/TranslationNotifications@master] Use SelectQueryBuilder::andWhere for conditional conditions

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

Change #1032875 merged by jenkins-bot:

[mediawiki/extensions/TranslationNotifications@master] Use SelectQueryBuilder::andWhere for conditional conditions

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