Closed holtkamp closed 5 years ago
The src/Composer/Repository/VcsRepository.php
(in composer 1.9.0) dropped the verbose
property and replaced it with the isVerbose
and isVeryVerbose
properties.
The Fxp\Composer\AssetPlugin\Repository\AssetVcsRepository
still tries to read the verbose
property, but because of that an ErrorException is triggered and caught in that class on line 59. https://github.com/fxpio/composer-asset-plugin/blob/9dd0e63d5ba5451993f1779529d61e316d5d4c99/Repository/AssetVcsRepository.php#L59
Because of that it can not complete the initTags
and initBranches
methods, which result in the exception.
Nice analysis @stefangr! Catching an Exception and "doing nothing" is always a tricky approach 🤓 .
https://github.com/composer/composer/commit/8288d2c456287d4ec2d746db1d285d6bd82d52ec#diff-83a02563c016f80c204feea10392f659 indeed resulted in the new properties you described: https://github.com/composer/composer/blob/8288d2c456287d4ec2d746db1d285d6bd82d52ec/src/Composer/Repository/VcsRepository.php#L33-L34
I think this can be appoached on two ways:
verbose
, for Composer < 1.9.0
isVerbose
for Composer >= 1.9.0
isVeryVerbose
for Composer >= 1.9.0
isVerbose
for Composer >= 1.9.0
isVeryVerbose
for Composer >= 1.9.0
Maybe replace now the catch exception with the class \Exception
by \RuntimeException
. TransportException
used by RemoteFilesystem
extends \RuntimeException
and all vcs drivers use the \RuntimeException
class.
https://github.com/fxpio/composer-asset-plugin/issues/332#issuecomment-519501124
Yea mean this in addition to adding support for the new properties isVerbose
and isVeryVerbose
, right?
Yes, off course.
And what approach as suggested in https://github.com/fxpio/composer-asset-plugin/issues/332#issuecomment-519479151 would you prefer?
The deprecated verbose
property is (at least) used here:
I will replace $this->verbose
by $this->io->isVerbose()
, because $io
is present since the first version, and $verbose
or $isVerbose
store this value. However, it is not the only bug with the last 1.9.0 version.
Compatibility with Composer 1.9 added by a5679e481c94e609c5c360cd05bf06058d9eb370.
With composer
1.9.0
the following works to install a Bower asset from themaster
branch of a cloned repository:However, when trying to reference a specific branch
patch-uri-fragment-path
on that cloned repository using:This results in the following error:
When rolling back to Composer
1.8.6
usingcomposer self-update 1.8.6
installing that specific branch works again.I had a look at the CHANGELOG of Composer and it seems nothing relevant changed with version
1.9.0
: https://github.com/composer/composer/blob/master/CHANGELOG.mdWhat could be the cause of not being able to install a specific branch?