Page MenuHomePhabricator

Introduce YAML to campaign configs
Closed, ResolvedPublic

Description

Currently the campaign configs are defined using JSON which is hard to edit for humans and better suited for serialization than configuring things. YAML 1.2 is much easier to read and write, it is also a superset of JSON which makes the transition essentially painless – all currently valid campaign configs will remain valid.

There are some security considerations, though, as one could use the many features of YAML to perform RCE through the configs. Thus, the implementation for YAML parsing must be reasonably secure. I propose the symfony/yaml package, which is already used by a few extensions (including SMW). It implements the 1.2 version of YAML which removed some of the crazier features. Additionally, this library only implements a further restricted subset of the language that should be sufficient for configuration files.

When rewriting campaign schema handling I'll also migrate the schema to YAML for better readability and the ability to add comments in code.

Event Timeline

Change 675334 had a related patch set uploaded (by Ostrzyciel; author: Ostrzyciel):
[mediawiki/extensions/MediaUploader@master] WIP: Switch campaign configs to YAML

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

Change 675334 merged by jenkins-bot:
[mediawiki/extensions/MediaUploader@master] Switch campaign configs to YAML

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

Ostrzyciel claimed this task.