dependabot-common 0.106.34 → 0.106.35

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: 8df12a99783599b0f3edf3cdc626f23bb5729955fe6087fd55f34bd094b3b4cc
4
- data.tar.gz: fe4466918754b920141ff5f8f85f9134934b8781281775d551e20021b31fd186
3
+ metadata.gz: e113808a578271526c147df4335fedb60cfeb19802f3f2e96f3bb09ee5d1f69a
4
+ data.tar.gz: 432aa7f481de6ec48e2ba29711bb41e6754075125ac83efcf31762761e19cdb6
5
5
  SHA512:
6
- metadata.gz: 10352a9876983214b6303fade68161ecfb61832f2a0c3edf21a2e3777f68b642ad06ed0bd421f25cb6538f23a1c4251d7e72f871efaf073d19688d066942081a
7
- data.tar.gz: eba843ea01479fd3fccc894e813eefbbdbf9b6437570055efc5898e2aac0df5946103cbfceebee0e4ea83dc3f67517398008d946ab4e6eaa0ea6597203805cba
6
+ metadata.gz: 653fc36e4e76f30d2edd7e3d5998a4d8a041a77262a48fe55d30a4faad063abf808b117eb180fd9ad5500d78bfcbdc7f5380eab823d4b8d6ac86b0f9ed2c7ff1
7
+ data.tar.gz: 3e401c7ea85e6626d164536d3cb721dd4f9915c31c3a068d4ef9e419f557ea0467edeb341c09aeed9e8cf177a1708f71bab25cac63a3764be916e1320473205b
@@ -131,7 +131,7 @@ module Dependabot
131
131
  retry_count += 1
132
132
  raise if retry_count > 3
133
133
 
134
- sleep(rand(0.9))
134
+ sleep(rand(1..1.99))
135
135
  retry
136
136
  end
137
137
  end
@@ -172,26 +172,28 @@ module Dependabot
172
172
  # A race condition may cause GitHub to fail here, in which case we retry
173
173
  retry_count ||= 0
174
174
  retry_count += 1
175
- retry unless retry_count >= 2
175
+ retry_count < 2 ? retry : raise
176
176
  end
177
177
 
178
178
  def create_branch(commit)
179
- github_client_for_source.create_ref(
180
- source.repo,
181
- "heads/#{branch_name}",
182
- commit.sha
183
- )
184
- rescue Octokit::UnprocessableEntity => e
185
- # Return quietly in the case of a race
186
- return nil if e.message.match?(/Reference already exists/i)
187
- raise if @retrying_branch_creation
179
+ ref = "heads/#{branch_name}"
180
+
181
+ begin
182
+ github_client_for_source.create_ref(source.repo, ref, commit.sha)
183
+ rescue Octokit::UnprocessableEntity => e
184
+ # Return quietly in the case of a race
185
+ return nil if e.message.match?(/Reference already exists/i)
186
+
187
+ retrying_branch_creation ||= false
188
+ raise if retrying_branch_creation
188
189
 
189
- @retrying_branch_creation = true
190
+ retrying_branch_creation = true
190
191
 
191
- # Branch creation will fail if a branch called `dependabot` already
192
- # exists, since git won't be able to create a folder with the same name
193
- @branch_name = SecureRandom.hex[0..3] + @branch_name
194
- retry
192
+ # Branch creation will fail if a branch called `dependabot` already
193
+ # exists, since git won't be able to create a dir with the same name
194
+ ref = "heads/#{SecureRandom.hex[0..3] + branch_name}"
195
+ retry
196
+ end
195
197
  end
196
198
 
197
199
  def update_branch(commit)
@@ -100,7 +100,7 @@ module Dependabot
100
100
  retry_count += 1
101
101
  raise if retry_count > 3
102
102
 
103
- sleep(rand(0.9))
103
+ sleep(rand(1..1.99))
104
104
  retry
105
105
  end
106
106
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dependabot
4
- VERSION = "0.106.34"
4
+ VERSION = "0.106.35"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.106.34
4
+ version: 0.106.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-06 00:00:00.000000000 Z
11
+ date: 2019-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-ecr