dependabot-common 0.111.12 → 0.111.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb22cba06a25cb551864e82276dc1bcfdab28dc5968c05c011e71d1a0b4c4f87
|
4
|
+
data.tar.gz: 92d63dbe180b2c07721f06c2c5a57d2a0c714e804eb82d76984386436ce20b65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0206816370c42988080bf78ee3304ff80670ede9e4d9a97e0429d026f29122275030ef175f149a3647073793b9766ee4887fd88af61c22e71fcfbff5c1c5155
|
7
|
+
data.tar.gz: ff7c003f83152f508dabbbb21abef82b6625326da655847a0323f3b9bd62e7a31dc465db87e900d2ff7fac786cda03785d60c89e5da929a7526472cf2e130636
|
@@ -14,6 +14,8 @@ module Dependabot
|
|
14
14
|
|
15
15
|
def upload_pack
|
16
16
|
@upload_pack ||= fetch_upload_pack_for(url)
|
17
|
+
rescue Octokit::ClientError
|
18
|
+
raise Dependabot::GitDependenciesNotReachable, [url]
|
17
19
|
end
|
18
20
|
|
19
21
|
def tags
|
@@ -37,28 +39,20 @@ module Dependabot
|
|
37
39
|
# rubocop:disable Metrics/CyclomaticComplexity
|
38
40
|
# rubocop:disable Metrics/PerceivedComplexity
|
39
41
|
def fetch_upload_pack_for(uri)
|
40
|
-
response =
|
41
|
-
service_pack_uri(uri),
|
42
|
-
idempotent: true,
|
43
|
-
**excon_defaults
|
44
|
-
)
|
45
|
-
|
42
|
+
response = fetch_raw_upload_pack_for(uri)
|
46
43
|
return response.body if response.status == 200
|
47
44
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
end
|
45
|
+
unless uri.match?(KNOWN_HOSTS)
|
46
|
+
raise Dependabot::GitDependenciesNotReachable, [uri]
|
47
|
+
end
|
52
48
|
|
53
|
-
|
54
|
-
|
55
|
-
when 501 then raise Octokit::NotImplemented
|
56
|
-
when 502 then raise Octokit::BadGateway
|
57
|
-
when 503 then raise Octokit::ServiceUnavailable
|
58
|
-
else raise Octokit::ServerError
|
59
|
-
end
|
49
|
+
if response.status < 400
|
50
|
+
raise "Unexpected response: #{response.status} - #{response.body}"
|
60
51
|
end
|
61
52
|
|
53
|
+
raise Octokit::Error.from_response(response) if uri.match?(/github\.com/i)
|
54
|
+
raise "Server error at #{uri}: #{response.body}" if response.status >= 500
|
55
|
+
|
62
56
|
raise Dependabot::GitDependenciesNotReachable, [uri]
|
63
57
|
rescue Excon::Error::Socket, Excon::Error::Timeout
|
64
58
|
retry_count ||= 0
|
@@ -72,6 +66,14 @@ module Dependabot
|
|
72
66
|
# rubocop:enable Metrics/CyclomaticComplexity
|
73
67
|
# rubocop:enable Metrics/PerceivedComplexity
|
74
68
|
|
69
|
+
def fetch_raw_upload_pack_for(uri)
|
70
|
+
Excon.get(
|
71
|
+
service_pack_uri(uri),
|
72
|
+
idempotent: true,
|
73
|
+
**excon_defaults
|
74
|
+
)
|
75
|
+
end
|
76
|
+
|
75
77
|
def tags_for_upload_pack(upload_pack)
|
76
78
|
peeled_lines = []
|
77
79
|
|
@@ -65,7 +65,8 @@ module Dependabot
|
|
65
65
|
|
66
66
|
def branch_exists?(name)
|
67
67
|
git_metadata_fetcher.ref_names.include?(name)
|
68
|
-
rescue Dependabot::GitDependenciesNotReachable
|
68
|
+
rescue Dependabot::GitDependenciesNotReachable => e
|
69
|
+
raise e.cause if e.cause&.message&.include?("is disabled")
|
69
70
|
raise(RepoNotFound, source.url) unless repo_exists?
|
70
71
|
|
71
72
|
retrying ||= false
|
@@ -311,24 +312,27 @@ module Dependabot
|
|
311
312
|
).signature
|
312
313
|
end
|
313
314
|
|
314
|
-
|
315
|
-
|
315
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
316
|
+
def handle_error(err)
|
317
|
+
case err
|
316
318
|
when Octokit::Forbidden
|
317
|
-
raise
|
319
|
+
raise RepoDisabled, err.message if err.message.include?("disabled")
|
320
|
+
raise RepoArchived, err.message if err.message.include?("archived")
|
318
321
|
|
319
|
-
raise
|
322
|
+
raise err
|
320
323
|
when Octokit::NotFound
|
321
|
-
raise
|
324
|
+
raise err if repo_exists?
|
322
325
|
|
323
|
-
raise RepoNotFound,
|
326
|
+
raise RepoNotFound, err.message
|
324
327
|
when Octokit::UnprocessableEntity
|
325
|
-
raise
|
328
|
+
raise err unless err.message.include?("no history in common")
|
326
329
|
|
327
|
-
raise NoHistoryInCommon,
|
330
|
+
raise NoHistoryInCommon, err.message
|
328
331
|
else
|
329
|
-
raise
|
332
|
+
raise err
|
330
333
|
end
|
331
334
|
end
|
335
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
332
336
|
end
|
333
337
|
end
|
334
338
|
end
|
data/lib/dependabot/version.rb
CHANGED