Skip to content
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

"--major-only" option for "outdated" command #10439

Closed
Seldaek opened this issue Jan 6, 2022 Discussed in #10438 · 0 comments · Fixed by #10827
Closed

"--major-only" option for "outdated" command #10439

Seldaek opened this issue Jan 6, 2022 Discussed in #10438 · 0 comments · Fixed by #10827
Labels
Milestone

Comments

@Seldaek
Copy link
Member

Seldaek commented Jan 6, 2022

Discussed in #10438

Originally posted by halloei January 6, 2022
I've written a CI job that runs every night and checks my PHP projects for available Composer package updates. The number of those updates are then displayed in a badge, so you can see at a glance if you should update your dependencies.

Currently the command is as follows:

composer outdated --locked --no-dev --minor-only --format json  | jq --raw-output '.locked | length'

It...

  • excludes dev dependencies
  • includes only updates that can be done without hassle (as they won't break anything)
  • outputs in JSON format so I can count the number of updates with jq

The output of this command is an integer which can be used to create the badge.

However, this won't include major updates from direct dependencies. I'd like to notice if there's a major update of one of them, because I can become active and update it. I thought about a second command with --direct --major-only and adding the result to the one of my previous command. But something like --major-only does not exist.

Would such an option be useful? How do you handle that kind of feature?

This would be nice to have I think. The flag should be added in both ShowCommand and OutdatedCommand, and support for it added in ShowCommand, if someone wants to do it.

@Seldaek Seldaek added the Feature label Jan 6, 2022
@Seldaek Seldaek added this to the Nice To Have milestone Jan 6, 2022
Seldaek added a commit to Seldaek/composer that referenced this issue Jun 7, 2022
@Seldaek Seldaek modified the milestones: Nice To Have, 2.4 Jun 7, 2022
Seldaek added a commit that referenced this issue Jun 9, 2022
emahorvat52 pushed a commit to emahorvat52/composer that referenced this issue Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant