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

Fix comparisons for semver style git tags #864

Merged
merged 1 commit into from
Dec 7, 2018

Conversation

lamont-granquist
Copy link
Contributor

This fixes this issue:

  [Software: ohai] W | 2018-12-07T12:41:02-05:00 | Version v14.8.10 for software ohai was not parseable. Comparison methods such as #satisfies? will not be available for this version.

This fixes this issue:

```
  [Software: ohai] W | 2018-12-07T12:41:02-05:00 | Version v14.8.10 for software ohai was not parseable. Comparison methods such as #satisfies? will not be available for this version.
```

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
@lamont-granquist lamont-granquist requested a review from a team as a code owner December 7, 2018 18:19
@lamont-granquist
Copy link
Contributor Author

lamont-granquist commented Dec 7, 2018

note that this supports "v10" and "v10.11" in addition to "v10.11.12", the former of which are not technically semver -- so the scope of this PR is technically broader than its title -- but since "v" is currently not parseable at all if stripping the leading v off of it results in something that is still not parseable it didn't start off parseable anyway so we're no worse off by being less strict ("be permissive in what you accept...")

@lamont-granquist
Copy link
Contributor Author

Note that this is being done tactically and should probably be replaced by mixlib-versioning, but we should probably go through our four different version comparison libraries and combine the features and kill off two of the remaining three (semverse is already retired):

I also wouldn't be too shocked if the ruby ecosystem had a better version comparison library floating around that had been produced sometime in the past 10 years...

Copy link
Contributor

@stevendanna stevendanna left a comment

Choose a reason for hiding this comment

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

👍 on this tactical change

@lamont-granquist lamont-granquist merged commit f61c32c into master Dec 7, 2018
@lamont-granquist lamont-granquist deleted the lcg/semver-git-tags branch December 7, 2018 19:16
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.

4 participants