Page MenuHomePhabricator

Attempting to run StructuredNavigation that requires PHP 7.4 fails CI tests, as tests setup only run PHP 7.2
Closed, ResolvedPublic

Description

I'll be honest, unfortunately I'm not super familiar with the CI infrastructure. :(

  • I had initially submitted patch https://gerrit.wikimedia.org/r/c/integration/config/+/624110 which ended up being split into: https://gerrit.wikimedia.org/r/c/integration/config/+/624344. This change was made because I noticed that just about every other extension used extension-quibble, so I figured this must have been the right one to use. From my understanding after digging through integration/config repo more, only PHP 7.2 gets run during tests, which are known as quibble-vendor-mysql-php72-selenium-docker and quibble-vendor-mysql-php72-noselenium-docker.
  • Before I had the extension hosted on GitHub, and I had initially required StructuredNavigation used to require PHP 7.2 to require at least PHP 7.4, since I decided to enforce typehinting properties, which I personally find very helpful.
  • I have recently moved this to Gerrit, and discovered the tests were failing then.

The patch that the tests failed are on (https://gerrit.wikimedia.org/r/c/mediawiki/extensions/StructuredNavigation/+/625721) which in case is because only PHP 7.2 is installed during tests, and PHP 7.4 only runs (afaik) during the gate and submit stage.

Here is the error saved in case (but it's already self-explanatory):

14:43:20 INFO:quibble.commands:>>> Start: Extension and skin tests: composer
14:43:20 INFO:quibble.commands:Running "composer test" for StructuredNavigation
14:43:20 ./composer.json is valid for simple usage with composer but has
14:43:20 strict errors that make it unable to be published as a package:
14:43:20 See https://getcomposer.org/doc/04-schema.md for details on the schema
14:43:20 No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
14:43:20 name : The property name is required
14:43:20 description : The property description is required
14:43:21 [6.9MiB/0.00s] Loading composer repositories with package information
14:43:21 [7.2MiB/0.08s] Updating dependencies (including require-dev)
14:43:22 [206.9MiB/1.92s] Dependency resolution completed in 0.002 seconds
14:43:22 [206.9MiB/1.92s] Your requirements could not be resolved to an installable set of packages.
14:43:22 [206.9MiB/1.92s] 
14:43:22   Problem 1
14:43:22     - This package requires php >=7.4 but your PHP version (7.2.31) does not satisfy that requirement.
14:43:22 
14:43:22 [205.4MiB/1.92s] Memory usage: 205.39MiB (peak: 223.23MiB), time: 1.92s
14:43:23 INFO:quibble.commands:<<< Finish: Extension and skin tests: composer, in 2.325 s

I would like to know how to move forward from here:
Are there any plans in the future for a CI test "setup" (akin to extension-quibble) could be introduced, where PHP 7.4 is running by default? It's my understanding that this would likely take some time and also be difficult, as well as since Wikimedia Prod is currently not compatible with PHP 7.4. This is fine with me, and so the other way I was thinking of degrading StructuredNavigation to just require PHP 7.2 by dropping the typehints on properties (this would also make it installable for more users). Should I go with option 2 in this situation? Thank you.

Event Timeline

extension-quibble refers to a template of jobs and is indeed the default for most extensions. In short:

  • when a patchset is send the template runs tests with php7.2
  • when one does a +2, there are additional jobs being run for php7.3 and 7.4

The reason is we want to avoid running all variants when a change is being iterated in order to save resources. One can run the tests with php7.3 and php7.4 on a change by commenting in Gerrit: check php which will trigger the php7.3 and php7.4 jobs.

We default to enforce 7.2 since that is what Wikimedia uses currently and is the minimal version required by MediaWiki.

MediaWiki 1.35 will require php 7.3 as determined via T257879, which mean some users might not be able to use your extension, then they can probably just upgrade to php 7.4 :]

I can craft a new template named extension-quibble-php74-or-later, we have similar templates for running composer test since the default is still to enforce php7.0 compatibility: composer-test-php72-or-later.

Change 626605 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] zuul: php7.4 only quibble template

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

Note that we do not have a php7.4 for phan yet :-\

Change 626605 merged by jenkins-bot:
[integration/config@master] zuul: php7.4 only quibble template

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

Thank you Hashar for your explanation (it makes sense), and for the updated patch in integration/config! I don't believe anything else is action-able left in this task, so I'll mark this as resolved.