Page MenuHomePhabricator

EventLogging PHP EventServiceClient should use EventBus->send().
Closed, ResolvedPublic

Description

In T253121: MEP Client MediaWiki PHP, we implemented a simple PHP client that can produce to EventGate as EventServiceClient. However, PHP is weird, and some things that have already been solved in EventBus->send() (in the EventBus extension) are biting us here. Specifically, PHP is auto-serializing boolean values as integers. There may be other problems too.

Instead of fix them one by one, we should add a dependency on EventBus in EventLogging, use an EventBus.EventBusFactory to get an EventBus instance that will produce to eventgate-analytics-external, and just call $eventBus->send() from EventLogging::submit().

This will require that we declare eventgate-analytics-external in (e.g.) ProductionServices.php, as well as set up a local envoy proxy configs to forward from a local http port to eventgate-analytics-external, as we do for the EventGate instances that EventBus currently uses.

Event Timeline

Change 658395 had a related patch set uploaded (by Ottomata; owner: Ottomata):
[mediawiki/extensions/EventLogging@master] [WIP] Use EventBus to send events for EventLogging PHP client

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

Change 658441 had a related patch set uploaded (by Mholloway; owner: Ottomata):
[mediawiki/extensions/EventLogging@master] [WIP] Use EventBus to send events for EventLogging PHP client

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

Change 658449 had a related patch set uploaded (by Mholloway; owner: Michael Holloway):
[integration/config@master] Load EventBus for EventLogging tests

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

Change 658449 merged by jenkins-bot:
[integration/config@master] Load EventBus for EventLogging tests

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

@hashar We're having some issues with getting CI to run after merging https://gerrit.wikimedia.org/r/658449.

See:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/EventLogging/+/658441
https://integration.wikimedia.org/ci/job/wmf-quibble-vendor-mysql-php72-docker/55139/console

12:55:29 * A dependency error was encountered while installing the extension "EventLogging": Could not find the registration file for the extension "EventBus"

@brennen pointed us to T263101: Make mediawiki core installer stop trying to find extensions early and check if they are loaded or not, but I'm not sure if that is related. Are we missing a needed configuration to get the quibble tests to pass?

Thanks!

Change 658922 had a related patch set uploaded (by Hashar; owner: Hashar):
[mediawiki/extensions/EventBus@master] (DO NOT SUBMIT) dummy change for wmf-quibble-* jobs

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

That is the MediaWiki installer failing:

* A dependency error was encountered while installing the extension "EventLogging": Could not find the registration file for the extension "EventBus"
* A dependency error was encountered while installing the extension "NavigationTiming": Could not find the registration file for the extension "EventBus"

Because EventBus is not inject in that job. You can see that at the top of the output the repositories it is cloning. The installer thus complain because EventLogging and NavigationTiming require EventBus but it is not there.

The reason is the wmf-quibble* jobs do not have any dependencies injected like it has been done for https://gerrit.wikimedia.org/r/658449 . The wmf-quibble* jobs come with an hard coded set of extensions which are cloned and we ensure those jobs are triggered for all extensions included in that job. This way we have a guarantee that any change made to any of those repositories are not going to break the tests. Ie if you send a change to either EventBus or EventLogging, the job runs tests for both extensions and we have a guarantee that the extensions participating are not breaking each other.

I have send a dummy change I wanted to use to verify EventBus behave properly if injected in the wmf-quibble* jobs but unfortunately the job is no more triggered. It is a glitch somewhere.

Change 658925 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] EventBus: add experimental wmf-quibble jobs

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

Change 658946 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] Add EventBus to the gate

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

Change 658925 merged by jenkins-bot:
[integration/config@master] EventBus: add experimental wmf-quibble jobs

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

The CI config change to add EventBus to the wmf-quibble* jobs is https://gerrit.wikimedia.org/r/c/mediawiki/extensions/EventBus/+/658922/

I have triggered the jobs by commenting check experimental on a dummy EventBus change: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/EventBus/+/658922/ . They are running and will eventually report. I guess if they pass we can get EventBus included (which also mean its test will be run for every single other repositories participating).

On the dummy change https://gerrit.wikimedia.org/r/c/mediawiki/extensions/EventBus/+/658922/ , the Selenium tests passed but the PHPUnit one fails which is T272998 which is being investigated/fixed up :)

@hashar looks like that bug is fixed? What is needed to get this passing? Thank you!

Change 658922 abandoned by Hashar:
[mediawiki/extensions/EventBus@master] (DO NOT SUBMIT) dummy change for wmf-quibble-* jobs

Reason:

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

Change 658395 abandoned by Ottomata:
[mediawiki/extensions/EventLogging@master] [WIP] Use EventBus to send events for EventLogging PHP client

Reason:
in favor of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/EventLogging/ /658441

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

Change 658946 merged by jenkins-bot:
[integration/config@master] Add EventBus to the gate

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

Mentioned in SAL (#wikimedia-operations) [2021-02-08T17:20:26Z] <otto@deploy1001> sync-file aborted: ProductionServices - Add eventgate-analytics-external - T272863 (no-op) (duration: 00m 02s)

Mentioned in SAL (#wikimedia-operations) [2021-02-08T17:21:38Z] <otto@deploy1001> Synchronized wmf-config/ProductionServices.php: ProductionServices - Add eventgate-analytics-external - T272863 (no-op) (duration: 01m 06s)

Mentioned in SAL (#wikimedia-operations) [2021-02-08T17:23:58Z] <otto@deploy1001> Synchronized wmf-config/CommonSettings.php: CommonSettings - Add eventgate-analytics-external - T272863 (no-op) (duration: 01m 06s)

Change 658441 merged by Ottomata:
[mediawiki/extensions/EventLogging@master] Use EventBus to send events for EventLogging PHP client

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

Mholloway claimed this task.