wikimedia / composer-merge-plugin

Merge one or more additional composer.json files at Composer runtime
MIT License
926 stars 160 forks source link

Composer-merge-plugin might be suppressing errors #180

Open hashar opened 4 years ago

hashar commented 4 years ago

Originally reported by @adamwight at https://phabricator.wikimedia.org/T238203

We saw that a composer install step can fail without breaking the CI build. This is bad because the following steps are dependent on composer libraries and will fail in mysterious ways. For example in https://phabricator.wikimedia.org/T238055 we saw:

Early failure did not crash the build:

[500.2MB/9.66s] Your requirements could not be resolved to an installable set of packages.
[500.2MB/9.66s] 
  Problem 1
    - The requested package wikimedia/assert ~0.2.2 is satisfiable by wikimedia/assert[v0.2.2] but these conflict with your requirements or minimum-stability.

[432.9MB/11.61s] > post-update-cmd: ComposerVendorHtaccessCreator::onEvent
[433.0MB/11.85s] Memory usage: 433.05MB (peak: 500.25MB), time: 11.85s
INFO:quibble.cmd:Run composer update for mediawiki/core finished in 12.055 s

But eventually resulted in more mysterious failure:

10:38:16 MediaWiki has been successfully installed. You can now visit <http://127.0.0.1:9412> to view your wiki. If you have questions, check out our frequently asked questions list: <https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ> or use one of the support forums linked on that page.
10:38:16 INFO:quibble.util:Copying /workspace/src/LocalSettings.php to /workspace/log/LocalSettings.php
10:38:16 INFO:quibble.util:Copying /workspace/src/LocalSettings-installer.php to /workspace/log/LocalSettings-installer.php
10:38:16 No syntax errors detected in /workspace/src/LocalSettings.php
10:38:16 INFO:mw.maintenance.update:php maintenance/update.php --quick
10:38:16 [8479a17855a39ea3813dd4b9] [no req]   Error from line 35 of /workspace/src/extensions/Wikibase/lib/WikibaseLib.entitytypes.php: Class 'Wikibase\DataModel\Entity\ItemId' not found
10:38:16 Backtrace:
10:38:16 #0 /workspace/src/extensions/Wikibase/repo/includes/WikibaseRepo.php(789): require()
10:38:16 #1 /workspace/src/extensions/Wikibase/repo/includes/WikibaseRepo.php(404): Wikibase\Repo\WikibaseRepo::getDefaultEntityTypes()
10:38:16 #2 /workspace/src/extensions/Wikibase/repo/includes/WikibaseRepo.php(561): Wikibase\Repo\WikibaseRepo::newInstance()
10:38:16 #3 /workspace/src/extensions/Wikibase/repo/RepoHooks.php(107): Wikibase\Repo\WikibaseRepo::getDefaultInstance()
10:38:16 #4 /workspace/src/includes/Hooks.php(174): Wikibase\RepoHooks::onSetupAfterCache()
10:38:16 #5 /workspace/src/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
10:38:16 #6 /workspace/src/includes/Setup.php(772): Hooks::run(string)
10:38:16 #7 /workspace/src/maintenance/doMaintenance.php(83): require_once(string)
10:38:16 #8 /workspace/src/maintenance/update.php(270): require_once(string)
10:38:16 #9 {main}

Running composer in the sub directory does show it fails:

$ composer update; echo $?
> ComposerHookHandler::onPreUpdate
Loading composer repositories with package information
Updating dependencies (including require-dev)                    
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package wikimedia/assert ~0.2.2 is satisfiable by wikimedia/assert[v0.2.2] but these conflict with your requirements or minimum-stability.

2

But the composer merge plugin happily ignored it.