From f480b63ecf9c6a65cfb3b41713558fb2627106d9 Mon Sep 17 00:00:00 2001 From: Philip Harrison Date: Fri, 26 Mar 2021 12:13:24 +0000 Subject: [PATCH 1/3] Treat dev and pr as pre-releases for gradle/maven Add `dev` as a pre-release token for gradle and maven. Also added `pr` as a pre-release token to maven to align with gradle. Reported here https://github.com/dependabot/dependabot-core/issues/3255 --- gradle/lib/dependabot/gradle/version.rb | 2 +- gradle/spec/dependabot/gradle/version_spec.rb | 5 +++++ maven/lib/dependabot/maven/version.rb | 4 ++-- maven/spec/dependabot/maven/version_spec.rb | 10 ++++++++++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/gradle/lib/dependabot/gradle/version.rb b/gradle/lib/dependabot/gradle/version.rb index ad6c6d6e87..86b69808c8 100644 --- a/gradle/lib/dependabot/gradle/version.rb +++ b/gradle/lib/dependabot/gradle/version.rb @@ -21,7 +21,7 @@ class Version < Gem::Version "b" => 2, "beta" => 2, "m" => 3, "milestone" => 3, "rc" => 4, "cr" => 4, "pr" => 4, - "snapshot" => 5, + "snapshot" => 5, "dev" => 5, "ga" => 6, "" => 6, "final" => 6, "sp" => 7 }.freeze diff --git a/gradle/spec/dependabot/gradle/version_spec.rb b/gradle/spec/dependabot/gradle/version_spec.rb index 89d127af87..9d69279f52 100644 --- a/gradle/spec/dependabot/gradle/version_spec.rb +++ b/gradle/spec/dependabot/gradle/version_spec.rb @@ -92,6 +92,11 @@ let(:version_string) { "1.2.1-1.3.40-eap13-67" } it { is_expected.to eq(true) } end + + context "with an dev token" do + let(:version_string) { "1.2.1-dev-65" } + it { is_expected.to eq(true) } + end end describe "#<=>" do diff --git a/maven/lib/dependabot/maven/version.rb b/maven/lib/dependabot/maven/version.rb index 8c583ecceb..21f5783e77 100644 --- a/maven/lib/dependabot/maven/version.rb +++ b/maven/lib/dependabot/maven/version.rb @@ -21,8 +21,8 @@ class Version < Gem::Version "a" => 1, "alpha" => 1, "b" => 2, "beta" => 2, "m" => 3, "milestone" => 3, - "rc" => 4, "cr" => 4, - "snapshot" => 5, + "rc" => 4, "cr" => 4, "pr" => 4, + "snapshot" => 5, "dev" => 5, "ga" => 6, "" => 6, "final" => 6, "sp" => 7 }.freeze diff --git a/maven/spec/dependabot/maven/version_spec.rb b/maven/spec/dependabot/maven/version_spec.rb index 34e47dd90a..eb17cf93f3 100644 --- a/maven/spec/dependabot/maven/version_spec.rb +++ b/maven/spec/dependabot/maven/version_spec.rb @@ -92,6 +92,16 @@ let(:version_string) { "1.0.0.sp7" } it { is_expected.to eq(false) } end + + context "with a pre-release" do + let(:version_string) { "2.10.0.pr3" } + it { is_expected.to eq(true) } + end + + context "with an dev token" do + let(:version_string) { "1.2.1-dev-65" } + it { is_expected.to eq(true) } + end end describe "#<=>" do From beea803cd8b2b0f54356593901346d37141773c7 Mon Sep 17 00:00:00 2001 From: Philip Harrison Date: Fri, 26 Mar 2021 13:43:40 +0000 Subject: [PATCH 2/3] Update gradle/spec/dependabot/gradle/version_spec.rb Co-authored-by: Jurre --- gradle/spec/dependabot/gradle/version_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/spec/dependabot/gradle/version_spec.rb b/gradle/spec/dependabot/gradle/version_spec.rb index 9d69279f52..471e100267 100644 --- a/gradle/spec/dependabot/gradle/version_spec.rb +++ b/gradle/spec/dependabot/gradle/version_spec.rb @@ -93,7 +93,7 @@ it { is_expected.to eq(true) } end - context "with an dev token" do + context "with a dev token" do let(:version_string) { "1.2.1-dev-65" } it { is_expected.to eq(true) } end From 4eda81bf2222b30cec766835fc9d66b687cf723b Mon Sep 17 00:00:00 2001 From: Philip Harrison Date: Fri, 26 Mar 2021 13:43:59 +0000 Subject: [PATCH 3/3] Update maven/spec/dependabot/maven/version_spec.rb Co-authored-by: Jurre --- maven/spec/dependabot/maven/version_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maven/spec/dependabot/maven/version_spec.rb b/maven/spec/dependabot/maven/version_spec.rb index eb17cf93f3..585c190834 100644 --- a/maven/spec/dependabot/maven/version_spec.rb +++ b/maven/spec/dependabot/maven/version_spec.rb @@ -98,7 +98,7 @@ it { is_expected.to eq(true) } end - context "with an dev token" do + context "with a dev token" do let(:version_string) { "1.2.1-dev-65" } it { is_expected.to eq(true) } end