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

mix hex.outdated shows wrong requirement version #322

Closed
lasseebert opened this issue Dec 4, 2016 · 6 comments
Closed

mix hex.outdated shows wrong requirement version #322

lasseebert opened this issue Dec 4, 2016 · 6 comments

Comments

@lasseebert
Copy link
Contributor

When I run mix hex.outdated, I get this line for the poison package:

Dependency                 Current  Latest  Requirement
...
poison                     2.2.0    3.0.0   >= 1.5.0
...

So it would seem that I can upgrade poison. But I can't. Running mix hex.outdated poison reveals this:

$ mix hex.outdated poison
There is newer version of the dependency available 3.0.0 > 2.2.0!

Parent         Requirement       
bamboo         >= 1.5.0          
ecto           ~> 1.5 or ~> 2.0  
ja_serializer  ~> 1.4 or ~> 2.0  
phoenix        ~> 1.5 or ~> 2.0  
tesla          >= 1.0.0          

A green requirement means that it matches the latest version.

So I have two packages depending on poison that allows upgrading to 3.0.0 and three that doesn't.

Am I missing something here, or is it a bug?

@ericmj
Copy link
Member

ericmj commented Dec 5, 2016

~> 2.0 roughly means ">= 2.0.0 and < 3.0.0" so your requirements should not match and you can't upgrade. We don't show all requirements on every package in the first view because that would be too noisy.

Does that explain how it works or do you still have a bug?

@ericmj
Copy link
Member

ericmj commented Dec 5, 2016

Maybe we should remove hex.outdated in favor of only keeping hex.outdated DEP?

@lasseebert
Copy link
Contributor Author

Ah ok, I thought the Requirement column in mix hex.outdated was supposed to show the combined requirement of all dependent packages. E.g. in the poison case above I would expect it to be ~> 1.5 or ~> 2.0, since that is the most restrictive requirement.

Even if this is not fixable, I think mix hex.outdated is still a useful overview of what could (perhaps) be upgraded.

@josevalim
Copy link
Member

I think mix hex.outdated is still relevant because I don't want to run mix hex.outdated for all deps, only for those need upgrading and likely the upgrade is not possible.

If the issue is showing only one requirement, maybe you could replace the requirement column by "Upgrade supported" and use Yes or No (see mix hex.outdated foo). Another option is to show all requirements that will fail the upgrade and so on.

@lasseebert
Copy link
Contributor Author

I think showing an "Upgrade supported" column instead is a good solution 👍

If @ericmj agrees, I would like to take a shot at implementing it ;)

@ericmj
Copy link
Member

ericmj commented Dec 5, 2016

We should change the last column to "Update possible" with Yes/No as values and the help text at the end should inform the user about the detailed view for more information.

Please go ahead if you want to work on this.

lasseebert added a commit to lasseebert/hex that referenced this issue Dec 5, 2016
It now takes all dependent packages into account and simply prints a Yes
or a No for outdated packages.

Fixes hexpm#322
lasseebert added a commit to lasseebert/hex that referenced this issue Dec 5, 2016
It now takes all dependent packages into account and simply prints a Yes
or a No for outdated packages.

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

No branches or pull requests

3 participants