Page MenuHomePhabricator

mwext-php72-phan-docker job fails on WikimediaMessages: A dependency error was encountered while installing the extension "MinervaNeue": Could not find the registration file for the extension "MobileFrontend"
Closed, ResolvedPublic

Description

I saw this in https://integration.wikimedia.org/ci/job/mwext-php72-phan-docker/11177/console
For patch https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/WikimediaMessages/+/535295/

23:56:02 A dependency error was encountered while installing the extension "MinervaNeue": Could not find the registration file for the extension "MobileFrontend"
23:56:02 [12387160f4db169a2121e2f1] [no req]   Wikimedia\Services\ServiceDisabledException from line 423 of /workspace/src/includes/libs/services/ServiceContainer.php: Service disabled: DBLoadBalancerFactory
23:56:02 Backtrace:
23:56:02 #0 /workspace/src/includes/MediaWikiServices.php(577): Wikimedia\Services\ServiceContainer->getService(string)
23:56:02 #1 /workspace/src/maintenance/doMaintenance.php(123): MediaWiki\MediaWikiServices->getDBLoadBalancerFactory()
23:56:02 #2 /workspace/src/maintenance/install.php(193): require_once(string)
23:56:02 #3 {main}

Details

Related Gerrit Patches:
integration/config : masterphan: stop installing MediaWiki

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 9 2019, 11:00 PM
Krinkle added a subscriber: Krinkle.

The issue with extension dependencies in Phab jobs is: T225512.

The service error is: T229601.

Krinkle triaged this task as Unbreak Now! priority.Sep 10 2019, 12:50 AM
Krinkle added subscribers: hashar, Anomie.
Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptSep 10 2019, 12:50 AM
Krinkle added a subscriber: Reedy.Sep 10 2019, 12:51 AM

Seems to be caused by T225512: install.php --with-extensions silently ignores extensions whose dependencies are not satisfied

Change 534641 merged by jenkins-bot:
[mediawiki/core@master] Revert and fix "Revert "Modify -—with-extensions to throw extension dependency errors""
https://gerrit.wikimedia.org/r/534641

And I wrote a quick announce to wikitech-l about having to define the requirements in CI config in addition of extension.json: https://lists.wikimedia.org/pipermail/wikitech-l/2019-September/092522.html

I don't think this had the desired effect - From a patch to WikimediaMessages
https://integration.wikimedia.org/ci/job/mwext-php72-phan-docker/11177/console

22:56:02 A dependency error was encountered while installing the extension "MinervaNeue": Could not find the registration file for the extension "MobileFrontend"
22:56:02 [12387160f4db169a2121e2f1] [no req]   Wikimedia\Services\ServiceDisabledException from line 423 of /workspace/src/includes/libs/services/ServiceContainer.php: Service disabled: DBLoadBalancerFactory
22:56:02 Backtrace:
22:56:02 #0 /workspace/src/includes/MediaWikiServices.php(577): Wikimedia\Services\ServiceContainer->getService(string)
22:56:02 #1 /workspace/src/maintenance/doMaintenance.php(123): MediaWiki\MediaWikiServices->getDBLoadBalancerFactory()
22:56:02 #2 /workspace/src/maintenance/install.php(193): require_once(string)
22:56:02 #3 {main}
22:56:02 Traceback (most recent call last):
22:56:02   File "/usr/local/bin/quibble", line 11, in <module>
22:56:02     load_entry_point('quibble==0.0.0', 'console_scripts', 'quibble')()
22:56:02   File "/usr/local/lib/python3.5/dist-packages/quibble/cmd.py", line 465, in main
22:56:02     cmd.execute(plan)
22:56:02   File "/usr/local/lib/python3.5/dist-packages/quibble/cmd.py", line 440, in execute
22:56:02     command.execute()
22:56:02   File "/usr/local/lib/python3.5/dist-packages/quibble/commands.py", line 428, in execute
22:56:02     mwdir=self.mw_install_path
22:56:02   File "/usr/local/lib/python3.5/dist-packages/quibble/mediawiki/maintenance.py", line 63, in install
22:56:02     'Install failed with exit code: %s' % p.returncode)
hashar renamed this task from A dependency error in CI tests to mwext-php72-phan-docker job fails on WikimediaMessages: A dependency error was encountered while installing the extension "MinervaNeue": Could not find the registration file for the extension &#34;MobileFrontend&#34;.Sep 10 2019, 7:51 AM
hashar added a subscriber: Jdforrester-WMF.

@Reedy mentioned the issue on https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/534641/

22:56:02 A dependency error was encountered while installing the extension "MinervaNeue": Could not find the registration file for the extension &#34;MobileFrontend&#34;

@hashar wrote:

That is on the phan job which has different set of dependencies :-\ For WikimediaMessage CI injects:

phan_dependencies = {
    'WikimediaMessages': ['GuidedTour', 'ORES', 'skins/MinervaNeue']
}

WikimediaMessages does not refer to MobileFrontend at all so Phan works just fine. But MinervaNeue does require MobileFrontend and thus fail the installer.
I don't think we have to run MediaWiki install for the Phan jobs, that should probably be skipped (quibble --skip-install).

@Jdforrester-WMF wrote:

Alternatively we could just make phan install regular + phan dependencies, instead of just the phan ones?

Change 535507 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] phan: stop installing MediaWiki

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

Mentioned in SAL (#wikimedia-releng) [2019-09-10T08:03:05Z] <hashar> Updated Phan jobs for T232413 | https://gerrit.wikimedia.org/r/#/c/integration/config/+/535507 phan: stop installing MediaWiki

hashar closed this task as Resolved.Sep 10 2019, 8:18 AM
hashar claimed this task.

Fixed by no more installing MediaWiki (which is not needed) and thus the dependency check is entirely bypassed. If the extension code refers to code that is not shipped, Phan will complain and the dependency would have to be added to integration/config.git zuul/parameter_functions.py phan_dependencies.

Verified on WikimediaMessages changes:

@Jdforrester-WMF

Alternatively we could just make phan install regular + phan dependencies, instead of just the phan ones?

The Phan dependencies are a different set, that is because Phan is exhaustive in its check eg it would complain when you refer to a class to another extension, although that extension is not needed to pass tests or there is no integration test to cover that usage. Eg you might refer to code in BetaFeatures for example which Phan will complain about, while none the tests actually verify the BetaFeatures integration. There is thus no need to add BetaFeatures as a dependency for tests, which also save us from running a few more tests. Eventually that dependency mess will need to be solved differently / cleaned out, but that will be for later.

I have reviewed test failures for MediaWiki extensions and skins since the change got merged. The two WikimediaMessages changes were the only ones affected by this issue.

Change 535507 merged by jenkins-bot:
[integration/config@master] phan: stop installing MediaWiki

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

@Jdforrester-WMF

Alternatively we could just make phan install regular + phan dependencies, instead of just the phan ones?

The Phan dependencies are a different set, that is because Phan is exhaustive in its check eg it would complain when you refer to a class to another extension, although that extension is not needed to pass tests or there is no integration test to cover that usage. Eg you might refer to code in BetaFeatures for example which Phan will complain about, while none the tests actually verify the BetaFeatures integration. There is thus no need to add BetaFeatures as a dependency for tests, which also save us from running a few more tests. Eventually that dependency mess will need to be solved differently / cleaned out, but that will be for later.

Yes, I know that Phan needs us to provide extra dependencies that aren't tested in integration tests, and (theoretically) it doesn't need integration dependencies, but my suggestion was merging the lists (so that the Phan dependency list is a list of "extras").