Page MenuHomePhabricator

Implement validator for message group configuration
Closed, ResolvedPublic

Description

For InTense, people are editing group configuration directly on the wiki. We need to validate the configuration on save.

Event Timeline

Nikerabbit claimed this task.
Nikerabbit raised the priority of this task from to High.
Nikerabbit updated the task description. (Show Details)
Nikerabbit subscribed.

I'm currently experimenting with https://github.com/romaricdrigon/MetaYaml. Seems simple enough and working, so I'm planning to use it. I already found out that our documentation on https://www.mediawiki.org/wiki/Help:Extension:Translate/Group_configuration is out of date:
The node 'root.BASIC' has not allowed extra key(s): codeBrowser

My plan is to add this as dependency in composer.json, but have it optional. I already have schema, but it is not complete as I'm planning to use hooks (or similar, probably an interface) system for different classes (Message groups, FFS, Insertables, StringMangler) to alter the schema. In other words, the static schema would be a bit loose, and when specific classes are used, they can then define what exactly they accept.

I already found out that our documentation on https://www.mediawiki.org/wiki/Help:Extension:Translate/Group_configuration is out of date:
The node 'root.BASIC' has not allowed extra key(s): codeBrowser

This message is really cryptic when out of context ("[the schema] hasn't allowed X" or "[the file] has a disallowed X"?), but I see https://www.mediawiki.org/w/index.php?title=Help%3AExtension%3ATranslate%2FGroup_configuration&diff=1346535&oldid=1019597 is already in use in Translate. Documented: https://www.mediawiki.org/w/index.php?title=Help%3AExtension%3ATranslate%2FGroup_configuration&diff=1346535&oldid=1019597

You also suggested moving this config from BASIC to FILES, as it's Gettext-specific.

Change 184148 had a related patch set uploaded (by Nikerabbit):
Implement message group configuration validation

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

Patch-For-Review

I have requested Joel to review this.

Change 184148 merged by jenkins-bot:
Implement message group configuration validation

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