You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have an invalid composer.json - any error will do. Running composer help should fail (e.g. add a comma at the end of an array where it shouldn't be seen)
Run upgrade-code recompose
Expected result: Error that implies the composer.json is broken, or something else
Actual result:
$ upgrade-code recompose
In ComposerExec.php line 97:
Could not find the composer executable.
Investigation
Looks like this is because of SilverStripe\Upgrader\Composer\ComposerExec::testExecPath() - it attempts to run composer about and fails if there's any error. Instead, it should fail one way for a file that can't be found, and fail differently if composer runs but returns an error (maybe just pull the error through)?
Given the likelihood that this code works with invalid composer files (fairly high I would imagine), it seems like this is worth doing.
The text was updated successfully, but these errors were encountered:
Could change for composer validate potentially?
Giving it impact/low as having a broken composer.json doesn't feel to be a too common problem in the first place. Please, feel free to change it if you think otherwise.
I'd argue that during an upgrade is when you're most likely to have a broken composer.json, because you're removing modulesew. Probably impact/low is okay though given at least now Google should find this thread when someone searches for that issue + silverstripe upgrade :-)
Another option could just be to include the output of composer validate as part of the error message?
Steps to reproduce
composer help
should fail (e.g. add a comma at the end of an array where it shouldn't be seen)upgrade-code recompose
Expected result: Error that implies the composer.json is broken, or something else
Actual result:
Investigation
Looks like this is because of
SilverStripe\Upgrader\Composer\ComposerExec::testExecPath()
- it attempts to runcomposer about
and fails if there's any error. Instead, it should fail one way for a file that can't be found, and fail differently if composer runs but returns an error (maybe just pull the error through)?Given the likelihood that this code works with invalid composer files (fairly high I would imagine), it seems like this is worth doing.
The text was updated successfully, but these errors were encountered: