dependabot-cargo 0.106.23 → 0.106.24

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: f1aca783bba761fde8b44113298cbc760b8e1fd83dffac3045071bb81f6268e0
4
- data.tar.gz: 16c3e9da55347b2db931984f94156d8bed019957fc68c57352ea36246297ee52
3
+ metadata.gz: dc6e9304f7db40025107361697ca2bca51127fa6ad403788017766031806679d
4
+ data.tar.gz: e0183664d01e57af16159dac69112fa2a1a7f89ad499fed2107e8d67fa30db23
5
5
  SHA512:
6
- metadata.gz: 16664ebfee8bcd8581ee8d3ae6e2ac27f11509802f2c37479612b150ba9906fc110d8c465a28f4233b127d521de0f9f1cffb4c5e38ebe1e9c5e6b31f7668874b
7
- data.tar.gz: 64af1f1bfaa4c9d560dcfd40ab0edfa92a469f6913a38b848cfb956e60fb883fb83f069fb3a0be7abf4f020394d6cc7d301e3a32fbd6af1a4b86c139b0b583df
6
+ metadata.gz: ca603be5112e1636948300ab9bb4dfb93ba7fa72b934d48ae77aec350d5e840e8e92d8c4a62088583f5dc570a29c1996cffce8f1fcccc3ac9cd4809931bd1130
7
+ data.tar.gz: 4e8aca8abc6e91b8de79295e48b5570a80ae77dbd3b9c033f38069565f007f0d684fc1463e1a1bacf8c91cf193b8661f43ac525abeae31c3a37e1f49d0a40bfc
@@ -186,11 +186,19 @@ module Dependabot
186
186
 
187
187
  if error.message.include?("authenticate when downloading repo") ||
188
188
  error.message.include?("HTTP 200 response: got 401")
189
- raise if unreachable_git_urls.none?
190
-
191
189
  # Check all dependencies for reachability (so that we raise a
192
190
  # consistent error)
193
- raise Dependabot::GitDependenciesNotReachable, unreachable_git_urls
191
+ urls = unreachable_git_urls
192
+
193
+ if urls.none?
194
+ url = error.message.match(UNABLE_TO_UPDATE).
195
+ named_captures.fetch("url").split(/[#?]/).first
196
+ raise if reachable_git_urls.include?(url)
197
+
198
+ urls << url
199
+ end
200
+
201
+ raise Dependabot::GitDependenciesNotReachable, urls
194
202
  end
195
203
 
196
204
  if error.message.match?(BRANCH_NOT_FOUND_REGEX)
@@ -232,30 +240,41 @@ module Dependabot
232
240
  # rubocop:enable Metrics/MethodLength
233
241
 
234
242
  def unreachable_git_urls
235
- @unreachable_git_urls ||=
236
- begin
237
- dependencies = FileParser.new(
238
- dependency_files: original_dependency_files,
239
- source: nil
240
- ).parse
241
-
242
- unreachable_git_dependencies =
243
- dependencies.
244
- select do |dep|
245
- checker = GitCommitChecker.new(
246
- dependency: dep,
247
- credentials: credentials
248
- )
249
-
250
- checker.git_dependency? && !checker.git_repo_reachable?
251
- end
243
+ return @unreachable_git_urls if defined?(@unreachable_git_urls)
244
+
245
+ @unreachable_git_urls = []
246
+ @reachable_git_urls = []
247
+
248
+ dependencies = FileParser.new(
249
+ dependency_files: original_dependency_files,
250
+ source: nil
251
+ ).parse
252
252
 
253
- unreachable_git_dependencies.map do |dep|
254
- dep.requirements.
255
- find { |r| r.dig(:source, :type) == "git" }.
253
+ dependencies.each do |dep|
254
+ checker = GitCommitChecker.new(
255
+ dependency: dep,
256
+ credentials: credentials
257
+ )
258
+ next unless checker.git_dependency?
259
+
260
+ url = dep.requirements.find { |r| r.dig(:source, :type) == "git" }.
256
261
  fetch(:source).fetch(:url)
257
- end
262
+
263
+ if checker.git_repo_reachable?
264
+ @reachable_git_urls << url
265
+ else
266
+ @unreachable_git_urls << url
258
267
  end
268
+ end
269
+
270
+ @unreachable_git_urls
271
+ end
272
+
273
+ def reachable_git_urls
274
+ return @reachable_git_urls if defined?(@reachable_git_urls)
275
+
276
+ unreachable_git_urls
277
+ @reachable_git_urls
259
278
  end
260
279
 
261
280
  def resolvability_error?(message)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-cargo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.106.23
4
+ version: 0.106.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.106.23
19
+ version: 0.106.24
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.106.23
26
+ version: 0.106.24
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement