-
Notifications
You must be signed in to change notification settings - Fork 942
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 nuget ignored package version handling #9824
Conversation
@@ -226,7 +226,7 @@ | |||
end | |||
|
|||
context "when a version range is specified using Ruby syntax" do | |||
let(:ignored_versions) { [">= 2.a, < 3.0.0"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was incorrect because it originally said to exclude anything greater than or equal to 2.a and less than 3, which is an empty set, and given that this test was really only checking the Ruby-specific syntax of 2.a
I simplified it.
@@ -671,7 +677,7 @@ def create_nupkg(nuspec_name, nuspec_content) | |||
its([:version]) { is_expected.to eq(version_class.new("2.0.0")) } | |||
|
|||
context "when the user is ignoring the lowest version" do | |||
let(:ignored_versions) { [">= 2.a, <= 2.0.0"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was originally incorrect for the same reason as the one above so it has been simplified.
3bb609b
to
3a16d12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
3a16d12
to
96eee27
Compare
96eee27
to
cb8dcdd
Compare
The current handling of
ignored_versions
in ajob.yml
file is incorrect. Consider an example from the unit tests; ajob.yml
could list that for a certain package,ignored_versions
should be< 1.1.1, > 1.1.1
which should be read as "ignore anything below 1.1.1 and ignore anything above 1.1.1" which boils down to "only accept version 1.1.1". The previous implementation did a slightly different thing of "negate (version is less than 1.1.1 AND version is greater than 1.1.1)" which is impossible; this was a wrong application of our good friend De Morgan.The proper fix here is to turn that check into "negate (version is less than 1.1.1 OR version is greater than 1.1.1)". Thankfully the Maven updater does the correct thing so I could almost directly copy what was done there.
Some additional changes had to be made, namely ensuring that the
ignored_versions
property was passed around everywhere and fixing some unit tests that weren't correct.