dependabot-nuget 0.176.0 → 0.178.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcd7e79ec7ee525413a1434f75185c313f759a431c2ff79d8748658b156ea55b
4
- data.tar.gz: b6c57dd5e4944bfc07739158442c181d10705f835d6f8ea1f6c67bea0a07e0d0
3
+ metadata.gz: 8389cfea58bf0a72e3170737916609e4110af64a45c6f0508f07e7c8be1239e2
4
+ data.tar.gz: c57795d1262f1ca15213def48416566f09431c80d1139c9f73b6e4292bf8733d
5
5
  SHA512:
6
- metadata.gz: ce1b5218af398612614f511995bc57e2f13fcebde34433dbf777e1e39f30604ff3eac4a0b231219223aa64053dce523e8b2b7fb871dd8ac91b1033811cf0c3f5
7
- data.tar.gz: 0b7f6b61ea0916902c734bf23991537579aa65235557c85ba316b4a6f1ac65616f89d1cb7e35d76bb40e39717d26a48c44ee49a9738efb5e54de3607fd6ba5d9
6
+ metadata.gz: b3d8a3647c5c0d871192a58054ea410fea2852fd7b39a0c1af0fe5883adeb37e94e64773481aedcf291b0fa2136ccb9a7d30692fb699ee55663d76c0638947b0
7
+ data.tar.gz: 5827fdaebbaf85e3272ce29226baed7453d66ee870158229b772a334924966c80958030150516b6b4ccb7f5cc46214653e1e81772e9b46f77dc4756367525124
@@ -88,6 +88,8 @@ module Dependabot
88
88
  end
89
89
 
90
90
  def convert_wildcard_req(req_string)
91
+ return ">= 0-a" if req_string == "*-*"
92
+
91
93
  return ">= 0" if req_string.start_with?("*")
92
94
 
93
95
  defined_part = req_string.split("*").first
@@ -59,7 +59,7 @@ module Dependabot
59
59
  end
60
60
  if search_url
61
61
  details[:search_url] =
62
- search_url + "?q=#{dependency.name.downcase}&prerelease=true"
62
+ search_url + "?q=#{dependency.name.downcase}&prerelease=true&semVerLevel=2.0.0"
63
63
  end
64
64
  details
65
65
  rescue JSON::ParserError
@@ -196,8 +196,8 @@ module Dependabot
196
196
  repository_url: DEFAULT_REPOSITORY_URL,
197
197
  versions_url: "https://api.nuget.org/v3-flatcontainer/"\
198
198
  "#{dependency.name.downcase}/index.json",
199
- search_url: "https://api-v2v3search-0.nuget.org/query"\
200
- "?q=#{dependency.name.downcase}&prerelease=true",
199
+ search_url: "https://azuresearch-usnc.nuget.org/query"\
200
+ "?q=#{dependency.name.downcase}&prerelease=true&semVerLevel=2.0.0",
201
201
  auth_header: {},
202
202
  repository_type: "v3"
203
203
  }
@@ -58,6 +58,8 @@ module Dependabot
58
58
  end
59
59
 
60
60
  def update_wildcard_requirement(req_string)
61
+ return req_string if req_string == "*-*"
62
+
61
63
  return req_string if req_string == "*"
62
64
 
63
65
  precision = req_string.split("*").first.split(/\.|\-/).count
@@ -172,6 +172,7 @@ module Dependabot
172
172
 
173
173
  dependency.requirements.any? do |req|
174
174
  reqs = parse_requirement_string(req.fetch(:requirement) || "")
175
+ return true if reqs.any? { |r| r == "*-*" }
175
176
  next unless reqs.any? { |r| r.include?("-") }
176
177
 
177
178
  requirement_class.
@@ -329,7 +330,7 @@ module Dependabot
329
330
  # For large JSON files we sometimes need a little longer than for
330
331
  # other languages. For example, see:
331
332
  # https://dotnet.myget.org/F/aspnetcore-dev/api/v3/query?
332
- # q=microsoft.aspnetcore.mvc&prerelease=true
333
+ # q=microsoft.aspnetcore.mvc&prerelease=true&semVerLevel=2.0.0
333
334
  {
334
335
  connect_timeout: 30,
335
336
  write_timeout: 30,
@@ -55,6 +55,8 @@ module Dependabot
55
55
  end
56
56
 
57
57
  # rubocop:disable Metrics/PerceivedComplexity
58
+ # rubocop:disable Metrics/CyclomaticComplexity
59
+ # rubocop:disable Metrics/AbcSize
58
60
  def compare_prerelease_part(other)
59
61
  release_str = @version_string.split("-").first&.split("+")&.first || ""
60
62
  prerelease_string = @version_string.
@@ -74,11 +76,31 @@ module Dependabot
74
76
 
75
77
  return -1 if prerelease_string && !other_prerelease_string
76
78
  return 1 if !prerelease_string && other_prerelease_string
79
+ return 0 if !prerelease_string && !other_prerelease_string
77
80
 
78
- prerelease_string.<=>(other_prerelease_string)
81
+ split_prerelease_string = prerelease_string.split(".")
82
+ other_split_prerelease_string = other_prerelease_string.split(".")
83
+
84
+ split_prerelease_string.zip(other_split_prerelease_string).each do |lhs, rhs|
85
+ result = compare_dot_separated_part(lhs, rhs)
86
+ return result unless result.zero?
87
+ end
88
+
89
+ 0
79
90
  end
80
91
 
81
92
  # rubocop:enable Metrics/PerceivedComplexity
93
+ # rubocop:enable Metrics/CyclomaticComplexity
94
+ # rubocop:enable Metrics/AbcSize
95
+
96
+ def compare_dot_separated_part(lhs, rhs)
97
+ return -1 if lhs.nil?
98
+ return 1 if rhs.nil?
99
+
100
+ return lhs.to_i <=> rhs.to_i if lhs.match?(/^\d+$/) && rhs.match?(/^\d+$/)
101
+
102
+ lhs <=> rhs
103
+ end
82
104
 
83
105
  def compare_build_info(other)
84
106
  return build_info.nil? ? 0 : 1 unless other.is_a?(Nuget::Version)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-nuget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.176.0
4
+ version: 0.178.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-28 00:00:00.000000000 Z
11
+ date: 2022-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dependabot-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.176.0
19
+ version: 0.178.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.176.0
26
+ version: 0.178.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement