Page MenuHomePhabricator

Rewrite campaign JSON Schema validation
Closed, ResolvedPublic


As noted in T275157, MediaUploader currently depends on EventLogging for validating its campaign configs. That is a wonky dependency and the validation library itself is severely limited. The alternative is the justinrainbow/json-schema package, which does not have i18n support for now (see T147137), but returns more comprehensive validation errors. I think in this particular case we can sacrifice i18n for moving the extension forward and simplifying code on the way. Campaign editing is a rather advanced use case anyway and it is not crucial for it to be localized.

In the current (developmental) version, there's no campaign validation at all, so that should be fixed along the way. The validation should not depend on merging the campaign config with the global config. The schema must describe just the YAML present on the campaign page to avoid confusion. The new schema should be defined in YAML for better readability and easier modifications in the future.

Event Timeline

Ostrzyciel raised the priority of this task from Low to Medium.
Ostrzyciel moved this task from To Triage to Feature on the MediaUploader board.
Ostrzyciel renamed this task from Make an abstract JSON validation interface and service to Rewrite campaign JSON Schema validation.Mar 28 2021, 2:32 PM
Ostrzyciel updated the task description. (Show Details)

Change 677649 had a related patch set uploaded (by Ostrzyciel; author: Ostrzyciel):

[mediawiki/extensions/MediaUploader@master] WIP: Add maintenance script for fixing invalid campaigns

Change 677649 merged by jenkins-bot:

[mediawiki/extensions/MediaUploader@master] Add maintenance script for fixing invalid campaigns