Validation warnings to show:
- Gadget with type=styles having non-CSS files
- Packaged gadgets not having at least one JS file (after T198758)
- Non-packaged gadgets having JSON files (after T198758)
- Style-only gadgets having peers
- Peer gadgets not being styles-only gadgets
- Scripts/styles/datas not being of JS/CSS/JSON contentmodel respectively, or not existing altogether
- Invalid page actions specified
- Non-existent namespace numbers specified (after https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Gadgets/+/624517/) (done)
- Invalid targets specified
- Invalid content models (specified as load condition)
- Default gadget requiring ES6
Currently all of these validations do take place at some point, but no warnings are shown to the user. The problematic parts in gadget definitions are silently ignored.
Approaches
- Expand GadgetDefinitionValidator (for gadget definition namespace only) – Pre-save hook that blocks the save in case of issues. The existence/contentmodel of the resource files could change, so it may not be a good idea to validate those here.
- Show warnings in Special:Gadgets – These can cover all kinds of validations.