sous-chefs / jenkins

Development repository for the jenkins cookbook
https://supermarket.chef.io/cookbooks/jenkins
Apache License 2.0
424 stars 635 forks source link

Fix plugin version parsing #677

Closed arothian closed 6 years ago

arothian commented 6 years ago

Description

Several Jenkins plugins use versioning schemes that do not match with standard gem versioning. In these cases, version strings will actually parse (thus the rescue is not called) if they would be considered a "prerelease" gem.

For example, Gem::Version.new('4.5.3-2.0') becomes 4.5.3.pre.2.0. This causes Jenkins plugins that match this type of error to always install the latest version, as this substitution results in a noop. See included test case for an example that currently fails against master.

This change throws out any parsed Gem::Version instances that would be considered a "prerelease" and uses string based version matching.

Issues Resolved

GH-676

Check List

tas50 commented 6 years ago

Thanks for the fix

Dispader commented 6 years ago

I wonder if this fix also addresses Issue #534 . I'll give it a test when a version of the cookbook drops with this commit.