New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added minor-only option to show command to only show packages with minor updates #5552
Conversation
|
LGTM |
| @@ -314,6 +315,11 @@ protected function execute(InputInterface $input, OutputInterface $output) | |||
| if ($showLatest && isset($latestPackages[$package->getPrettyName()])) { | |||
| $latestPackackage = $latestPackages[$package->getPrettyName()]; | |||
| } | |||
|
|
|||
| if ($input->getOption('outdated') && $input->getOption('minor-only') && $latestPackackage && (!$this->isImmediateSemverCompliantUpgradeNeeded($package, $latestPackackage) || $latestPackackage->isAbandoned())) { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implementation is broken: even if the latest package is a new major version, it does not mean that there is no new versions of the packages for the major version you use.
You will need to change the way to fetch packages instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, well spotted.
Assuming 1.6.1 is installed, and the latest is 1.7.2, but the 1.6 branch also has a 1.6.2 tag, then ~1.6.0 and 1.7.2 would yield a no-upgrade-required state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, thanks. Will look into this.
|
LGTM |
|
Thanks! |
|
Strike that, got confused myself. ;-) |
This adds a new option to the show command: --minor-only.
When used in combination with --outdated, it will only show packages that have minor semver-compatible updates.
The use case for this is that we want to use composer to check if our project has any direct dependencies with minor semver-compatible updates, and fail our CI build if that's the case. The alternative would've been either trying to parse the original output checking for minor versions, or write a separate tool that hooks into composer to do the check.
This seemed like the simplest option.
Looking forward to your feedback.