dependabot-common 0.111.52 → 0.111.53
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dependabot/pull_request_creator/github.rb +25 -12
- data/lib/dependabot/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fd99525114b6d76a071677e573b8bd90ecf54e8ae8f4fd7bb7479c2b217f5cb
|
4
|
+
data.tar.gz: 1dc48dc0faa587760e59b98f46b7c20c65970bf8931f551f758643485205de1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9674fc031ca500653cbae288db5b84b794e787f9001b03524fd8ef9ecb11ca6e0bc2ef2014eb8c3a36fa1a4ba418670aa28ae8604cec8ddc10295f998bc35b26
|
7
|
+
data.tar.gz: 3466cb3357c8b7873c6d3af10fc0f33bed0536acad0236f578a32b2fa10ea182fbe6645b68821820588972099ad01c2c96cef761ec31e132113f14b014bdb453
|
@@ -118,33 +118,40 @@ module Dependabot
|
|
118
118
|
def create_commit
|
119
119
|
tree = create_tree
|
120
120
|
|
121
|
-
options = author_details&.any? ? { author: author_details } : {}
|
122
|
-
|
123
|
-
if options[:author]&.any? && signature_key
|
124
|
-
options[:author][:date] = Time.now.utc.iso8601
|
125
|
-
options[:signature] = commit_signature(tree, options[:author])
|
126
|
-
end
|
127
|
-
|
128
121
|
begin
|
129
122
|
github_client_for_source.create_commit(
|
130
123
|
source.repo,
|
131
124
|
commit_message,
|
132
125
|
tree.sha,
|
133
126
|
base_commit,
|
134
|
-
|
127
|
+
commit_options(tree)
|
135
128
|
)
|
136
129
|
rescue Octokit::UnprocessableEntity => e
|
137
130
|
raise unless e.message == "Tree SHA does not exist"
|
138
131
|
|
139
132
|
# Sometimes a race condition on GitHub's side means we get an error
|
140
133
|
# here. No harm in retrying if we do.
|
141
|
-
|
142
|
-
retry_count += 1
|
143
|
-
raise if retry_count > 10
|
144
|
-
|
134
|
+
raise_or_increment_retry_counter(counter: @commit_creation, limit: 3)
|
145
135
|
sleep(rand(1..1.99))
|
146
136
|
retry
|
147
137
|
end
|
138
|
+
rescue Octokit::UnprocessableEntity => e
|
139
|
+
raise unless e.message == "Tree SHA does not exist"
|
140
|
+
|
141
|
+
raise_or_increment_retry_counter(counter: @tree_creation, limit: 1)
|
142
|
+
sleep(rand(1..1.99))
|
143
|
+
retry
|
144
|
+
end
|
145
|
+
|
146
|
+
def commit_options(tree)
|
147
|
+
options = author_details&.any? ? { author: author_details } : {}
|
148
|
+
|
149
|
+
if options[:author]&.any? && signature_key
|
150
|
+
options[:author][:date] = Time.now.utc.iso8601
|
151
|
+
options[:signature] = commit_signature(tree, options[:author])
|
152
|
+
end
|
153
|
+
|
154
|
+
options
|
148
155
|
end
|
149
156
|
|
150
157
|
def create_tree
|
@@ -336,6 +343,12 @@ module Dependabot
|
|
336
343
|
).signature
|
337
344
|
end
|
338
345
|
|
346
|
+
def raise_or_increment_retry_counter(counter:, limit:)
|
347
|
+
counter ||= 0
|
348
|
+
counter += 1
|
349
|
+
raise if counter > limit
|
350
|
+
end
|
351
|
+
|
339
352
|
# rubocop:disable Metrics/CyclomaticComplexity
|
340
353
|
def handle_error(err)
|
341
354
|
case err
|
data/lib/dependabot/version.rb
CHANGED