Bump all updated packages when running composer update with given packages#12556
Bump all updated packages when running composer update with given packages#12556kubawerlos wants to merge 2 commits into
composer update with given packages#12556Conversation
aec3559 to
0f82a85
Compare
| $bumpAfterUpdate === 'no-dev', | ||
| $input->getOption('dry-run'), | ||
| $input->getArgument('packages') | ||
| [] |
There was a problem hiding this comment.
That will bump EVERYTHING, not just updated packages.. Which I think is kinda surprising behavior if you are explicitly only updating some packages.
I however don't really see an easy way to get the list of updated packages, but you could perhaps get the list of dependents from the allowlisted packages, that should be doable to read from the $composer->getRepository(), and only do that if $updateAllowTransitiveDependencies allows it. That'll still be a bunch of code tho to do correctly.. Not sure if worth it.
There was a problem hiding this comment.
Ok so had some more thoughts about this and I think the only clean way to do it would be to store $lockTransaction on a property at Installer.php:508 - then add a getLockTransaction(): ?LockTransaction getter so that you can fetch it from the UpdateCommand, and in there you can look at operations and make sure to add all packages that have been updated to the array here instead of passing an empty array. That shouldn't be too much code and will work accurately.
|
@Seldaek do you think this is not a good idea anymore, or have you closed it to not have it hanging? I planned to implement it "soon". |
|
Yeah feel free to reopen when you have time, I thought you lost interest and closed to clean up sorry |
Packages
acme/fooandacme/barare incomposer.json.Currently running
composer update acme/bar --bump-after-update --with-all-dependenciesupdates both packages, but only bumpsacme/bar.