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

Bundle outdated's exit status is always 1, even when outdated gems are filtered out when filtering on groups #7425

Open
gee-forr opened this issue Jan 26, 2024 · 5 comments

Comments

@gee-forr
Copy link

The problem

I'd like to start using bundle outdated --only-explicit in my CI pipelines to warn when our gems are getting outdated.

The problem is, if there are outdated gems and they're filtered out, the exit status is still 1, when I would expect it to be 0.

I've taken a look at the lib/cli/outdated.rb code and believe I can fix this issue, and I'm happy to push a PR if you believe this is a valid bug?

Did you try upgrading rubygems & bundler?

This bug is present in the latest version of bundler, and the latest version of the code here on github.

Post steps to reproduce the problem

Use this gemfile:

source 'https://rubygems.org'

# the foo group is necessary for triggering this bug
group :foo do
  gem 'shoulda-matchers',   '~> 5.3.0'
end

Run these commands:

  1. This should show the outdated gem, and exit with a status of 1
bundle outdated --only-explicit --group foo
  1. This should show No minor updates to display. and return with an exit status of 0, but instead shows the output header, and exits with a status of 1
bundle outdated --only-explicit  --group foo --filter-minor

Which command did you run?

bundle outdated --only-explicit --filter-minor --filter-patch --group foo on a Gemfile with no minor or patch version updates available

What were you expecting to happen?

I was expecting bundle outdated to exit with a status of 0

What actually happened?

It exits with a status of 1

@indirect
Copy link
Member

That sounds like a valid bug to me! Happy to get a PR to fix it.

@deivid-rodriguez
Copy link
Member

Agreed!

@gee-forr
Copy link
Author

That sounds like a valid bug to me! Happy to get a PR to fix it.

Excellent news! I'll put something together when I've got a gap this week.

@deivid-rodriguez
Copy link
Member

@gee-forr Still interested in contributing this? Any help needed?

@gee-forr
Copy link
Author

gee-forr commented Mar 28, 2024

@gee-forr Still interested in contributing this? Any help needed?

Hey @deivid-rodriguez - Yeah - I still 100% plan on issuing a PR. I've just had an intense 2024 so far in terms of work commitments. As soon as my work load subsides a little, I'll have some time to issue a fix.

Apologies for the wait.

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

No branches or pull requests

3 participants