Page MenuHomePhabricator

Librarise Libs/JsonSchemaValidation or replace
Open, Needs TriagePublic

Description

Either the Libs/JsonSchemaValidation inside EventLogging should be moved out to a library, or if possible, one of the existing json schema libraries in MediaWiki-Vendor (opis/json-schema or justinrainbow/json-schema) should be used instead.

It seems various of the classes in Libs/JsonSchemaValidation have ancestry back in MediaWiki-extensions-JsonData; if we Librarize this code, we can use Composer to include the classes into both (and MediaWiki-Vendor for WMF production), rather than having duplicate code.

It's unclear if opis/json-schema or justinrainbow/json-schema can replace this code in either case, but at least factoring it out into a library would be a good step in the right direction... See also T293710: Migrate from justinrainbow/json-schema to opis/json-schema and remove from MW vendor

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Noting a few of these classes are used outside of EventLogging.

And there's the MediaWiki-extensions-JsonData which has numerous similarly named classes... See also T303132: Archive the JsonData extension

If someone has a better idea if opis/json-schema or justinrainbow/json-schema (preferably the latter) can replace the code, rather than factoring it out.. That'd be useful to know

WMF is trying to stop using on wiki schemas for EventLogging. From our perspective, we can and should remove any support in EventLogging for on wiki JSONSchemas. However there may be 3rd party wikis that use on wiki JSONSchemas via EventLogging, so I'm not sure if we can just do this.

In either case, removing JSONSChema support from EventLogging extension will be blocked until T259163: Migrate legacy metawiki schemas to Event Platform is totally finished anyway.