Page MenuHomePhabricator

Feature request: Evaluate "require" field from "extension.json" in automated test environment
Open, MediumPublic

Description

At the moment one must declare inter-extension dependencies within the parameter_functions.py script of the integration-config. Since MediaWiki version 1.31 the extension.json file also allows to specify such dependencies. It would be nice to have the test environment evaluate the entry from extension.json, so the dependency doesn't need to be maintained in two different places.

[1] https://github.com/wikimedia/integration-config/blob/master/zuul/parameter_functions.py#L133

The zuul/parameter_functions.py is a centrally hardcoded list of dependencies. That doesn't make it easy to adjust.

Since 1.29 extensions can specify dependencies, so we can probably parse extension.json and recursively clone all the dependencies. https://www.mediawiki.org/wiki/Manual:Extension_registration#Requirements_(dependencies)

This feature request was inspired by @Umherirrender in T130811

See also T182472: Allow extension registration to suggest optional extension/skin or MediaWiki version

Event Timeline

There are some dependency also for extensions not strong required, but needed by tests to make unit tests or phan happy (https://gerrit.wikimedia.org/r/#/c/401407/).
It is possible that this extensions are not listed as "required". That means the old way is still needed or maybe a "suggest" key can help here to list them (T182472)

From a discussion I had to day, we would first need the ability to define an extension as being optional which is T182472

An example is AbuseFilter which can be used by itself. But it also has feature that enable themselves when CheckUser or CodeEditor extensions are present and we need CI to have those in order to run the integration tests between those extensions.

While Quibble learned to recursively process extension.json and automatically clone all the dependencies (via --resolve-requires), we can not define those optional dependencies yet in extension.json.