Page MenuHomePhabricator

[ES-M5] [EPIC] Migrate EntitySchema Hooks to use MediaWiki hook interfaces and DI
Open, Needs TriagePublic

Description

Context

As of MediaWIki 1.35, it is possible to utilize a new set of interfaces and instantiated classes to register hook handlers. This was done to improve, static validity of hook handler parameters, and enable dependency injection for hook handler classes.

Currently, the Entity Schema extension still registers its hook handlers through a class with static methods. While this methodology is not deprecated, switching to the newer hook pattern will allow us to leverage its advantages.

For more information about hooks and hook handlers, see:

Main Objectives

Similarly to what was done in the WikibaseClient extension in T256246: Migrate Client hooks to extension JSON, we would like to migrate each of the hook handlers in the Entity Schema extension to use MediaWiki's hook interfaces. This involves:

Considerations

As there might be a need for dependency injection in some of the hook handler, this may depend on some tickets of T329828: [ES-M5] [EPIC] Migrate EntitySchema to use the MediaWiki Service Container .

While a bulk of this work will most likely be completed with upcoming feature development in EntitySchema, it is pivotal that the migration is complete, in order to ensure consistency in the patterns employed in the codebase and avoid degradation of the codebase's comprehensibility by mixing various code organization ideas.

Event Timeline

ItamarWMDE renamed this task from [EPIC] Migrate EntitySchema Hooks to use MediaWiki hook interfaces and DI to [ES-M5] [EPIC] Migrate EntitySchema Hooks to use MediaWiki hook interfaces and DI.Sep 20 2023, 2:32 PM