Background
Currently, WikimediaEvents depends on EventLogging and EventBus. However, increasingly more experiment owners are putting their experiment code in the WikimediaEvents extension and, because TestKitchen isn't depended on and therefore might not be available, they have to wrap their experiment code in guards or loading statements, e.g.
class Hooks { public function __construct( private readonly ExperimentManagerInterface ?experimentManager = null ) { } public function myAwesomeHook(): void { if ( $this->experimentManager ) { $e = $this->experimentManager->getExperiment( 'my-awesome-experiment' ); } } }
mw.loader.using( 'ext.testKitchen', () => { const e = mw.testKitchen.getExperiment( 'my-awesome-experiment' ); } );
These aren't necessarily Bad™ per se but they are unnecessary and, in the case of loading statements, they could lead to experiment-related analytics events being lost as the ext.testKitchen module isn't loaded before the user navigates away from the page.
AC
- WikimediaEvents lists TestKitchen as a requirement and this change has rolled out. The rollout should happen before removing the mw.loader.using( 'ext.testKitchen', … ) statements.
- PSA in talk-to channel that this change is happening and the longer format is no longer required.
- All mw.loader.using( 'ext.testKitchen', … ) statements are removed from WikimediaEvents
- CI passes