MediaWiki-extensions-CommunityConfiguration creates configuration forms for other extension, based on registered schemas. Those schemas need to meet certain requirements to be considered valid by CommunityConfiguration. Those requirements should be validated by CI, to alert developers of a mistake as soon as possible. Validating this within CI is trickier than usually, as the requirements are imposed by the CommunityConfiguration extension, but need to be met within its client extension.
We plan to create a base testing class in CommunityConfiguration, which would contain relevant tests for the schemas. This base class can then be inherited from in client extensions (such as GrowthExperiments, AutoModerator or Babel), actually ensuring the requirements are met. We need to take care to test all schemas, not only schemas that happen to be registered by default (there would likely need to be a separate list of schemas).
Example of rules to validate:
- all public constants that are arrays contain the required keys to form a schema (JsonSchema::TYPE and JsonSchema::DEFAULT; other keys are required based on the type),
- JsonSchema is a parent of the schema,
- verifying at least the required i18n messages exist,
- maybe: version is included (so that migrations can be done if needed),
- to ensure integration works: schema builder is capable of generating the schema