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

Introduce benevolent version comparator #40

Merged
merged 1 commit into from
Aug 8, 2018

Conversation

msrb
Copy link
Member

@msrb msrb commented Aug 2, 2018

No description provided.

@msrb
Copy link
Member Author

msrb commented Aug 2, 2018

[test]

@msrb
Copy link
Member Author

msrb commented Aug 2, 2018

Ideally, this should land in https://github.com/fabric8-analytics/fabric8-analytics-version-comparator in future. If it's useful.

Copy link
Member

@tisnik tisnik left a comment

Choose a reason for hiding this comment

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

Is not it supported by https://pypi.org/project/semantic_version/ library?

@msrb
Copy link
Member Author

msrb commented Aug 2, 2018

Hmm, I am not familiar with the library. So maybe (?) But we are interested in a very special way of comparing versions here.

    Examples:
        BenevolentVersion('1.0.0') == BenevolentVersion('1')  # True
        BenevolentVersion('5.0.RELEASE') == BenevolentVersion('5.0.0')  # True

So we don't want to know whether beta version is greater than alpha. This comparator ignores such release strings and considers the versions equal.

@msrb
Copy link
Member Author

msrb commented Aug 2, 2018

And the reason for such "benevolent" comparator is the weirdness of NVD, where versions don't always reflect the reality.

@tisnik
Copy link
Member

tisnik commented Aug 2, 2018

I see. Yes in case the SemVer is not followed, let's use Benevolent Class :) IMHO it is a really good candidate for a regular package and for module in our famous fabric8-analytics-comparator.

@tisnik
Copy link
Member

tisnik commented Aug 2, 2018

ah I forgot - LGTM of course ;)

@msrb msrb merged commit 3f2e261 into fabric8-analytics:master Aug 8, 2018
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

Successfully merging this pull request may close these issues.

2 participants