Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bump all updated packages when running composer update with given packages#12556

Closed
kubawerlos wants to merge 2 commits into
composer:2.8from
6b7562617765726c6f73:fix_UpdateCommand
Closed

Bump all updated packages when running composer update with given packages#12556
kubawerlos wants to merge 2 commits into
composer:2.8from
6b7562617765726c6f73:fix_UpdateCommand

Conversation

@kubawerlos
Copy link
Copy Markdown
Contributor

Packages acme/foo and acme/bar are in composer.json.

Currently running composer update acme/bar --bump-after-update --with-all-dependencies updates both packages, but only bumps acme/bar.

@kubawerlos kubawerlos marked this pull request as ready for review September 27, 2025 16:07
$bumpAfterUpdate === 'no-dev',
$input->getOption('dry-run'),
$input->getArgument('packages')
[]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Seldaek added this to the 2.9 milestone Oct 6, 2025
@Seldaek Seldaek modified the milestones: 2.9, Nice To Have Oct 28, 2025
@Seldaek Seldaek deleted the branch composer:2.8 November 8, 2025 12:18
@Seldaek Seldaek closed this Nov 8, 2025
@kubawerlos
Copy link
Copy Markdown
Contributor Author

@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".

@Seldaek
Copy link
Copy Markdown
Member

Seldaek commented Nov 15, 2025

Yeah feel free to reopen when you have time, I thought you lost interest and closed to clean up sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants