Page MenuHomePhabricator

Convert all hooks to EventFactory
Closed, ResolvedPublic

Description

In https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/EventBus/+/460463/ I've started converting the event creation code from the hooks into a new EventFactory class with more narrow interfaces. That class is much easier to cover with unit tests. This task is created to track the completion of the work - all the events should be created in EventFactory and all of them should be covered with unit tests.

We probably want to separate the work into multiple stages in order to avoid deploying a huge change in a single step for risk mitigation. Preferably, the interfaces for factory methods should be as narrow as possible, for example using LinkTarget instead of a Title, RevisionRecord instead of Revision etc.

The best way to test this is via Vagrant and eventbus role.

Event Timeline

Pchelolo created this task.Sep 17 2018, 6:15 PM
Restricted Application added a project: Analytics. · View Herald TranscriptSep 17 2018, 6:15 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 460463 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/extensions/EventBus@master] Define EventFactory for transforming MW objects to events.

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

Milimetric moved this task from Incoming to Radar on the Analytics board.Sep 24 2018, 3:42 PM

Change 460463 merged by jenkins-bot:
[mediawiki/extensions/EventBus@master] Define EventFactory for transforming MW objects to events.

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

Change 490141 had a related patch set uploaded (by Holger Knust; owner: Holger Knust):
[mediawiki/extensions/EventBus@master] T204575: Added new event factory methods

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

Change 490141 had a related patch set uploaded (by Holger Knust; owner: Holger Knust):
[mediawiki/extensions/EventBus@master] EventFactory: Added new event factory methods

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

Change 490141 merged by Ppchelko:
[mediawiki/extensions/EventBus@master] EventFactory: Added new event factory methods

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

Change 498393 had a related patch set uploaded (by Holger Knust; owner: Holger Knust):
[mediawiki/extensions/EventBus@master] EventBus: Moved remaining events to factory class

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

@CCicalese_WMF is this related to the work you're doing on extension interface?

Yes, it is related, although it is being done independently since it is ahead of the start of that work.

Change 498393 merged by Ppchelko:
[mediawiki/extensions/EventBus@master] EventBus: Moved remaining events to factory class

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

mobrovac closed this task as Resolved.Mar 27 2019, 10:49 PM
mobrovac triaged this task as Normal priority.
mobrovac added a subscriber: mobrovac.

The final patch has been merged, resolving. Thank you @holger.knust !