Page MenuHomePhabricator

Remove the ICampaignsDatabase abstraction
Closed, ResolvedPublic

Description

The ICampaignsDatabase abstraction was created in the early days of the CampaignEvents extension to make it easier to potentially migrate the code to an off-MW application. This clearly hasn't happened, and is not going to happen anytime soon. On the other hand, this abstraction (and also others) make it more difficult to reason about the code, especially for developers who are not familiar with the code base; for instance, see T350947#9659908, T360517, and T302858#8354617. It also means we need to keep the abstraction up-to-date with MW core changes, which isn't really happening; for instance, this abstraction does not support the "new" QueryBuilder pattern. Therefore, we should just remove the abstraction and use normal MW classes instead.

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptMar 26 2024, 3:49 PM

Change #1016469 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/CampaignEvents@master] Remove ICampaignsDatabase and MWDatabaseProxy

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

Change #1016470 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/WikimediaCampaignEvents@master] Update code for ICampaignsDatabase removal

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

Change #1016469 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] Remove ICampaignsDatabase and MWDatabaseProxy

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

Hi @vaughnwalters just a note, on this task the changes were more technical changes on the code base, but it basically involves how we communicate with the DB, same for T360517, so the tests I think you could do here could be a general check on every special page to check it the data is being correctly shown.

Change #1016470 merged by jenkins-bot:

[mediawiki/extensions/WikimediaCampaignEvents@master] Update code for ICampaignsDatabase removal

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

Hi @vaughnwalters just a note, on this task the changes were more technical changes on the code base, but it basically involves how we communicate with the DB, same for T360517, so the tests I think you could do here could be a general check on every special page to check it the data is being correctly shown.

All data is being shown correctly except on Special:MyEvents the number of participants is not displaying correctly. I am not sure if it is related to this ticket or not, but I have created this task for it T362929

This is the only error I have seen in displaying data in any of the Special pages, and I have created a follow up task for it, so I am marking this as done.