dependabot-common 0.151.1 → 0.154.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: c6c34567520949a76f0dbf7d249661def4c89a742162485337625e60fd63ff27
4
- data.tar.gz: b341918ad95d6036adb20f12e9e2ed0dd20ba7e8dbcdded6cb082ac50dc689a7
3
+ metadata.gz: be7a0372c2f013d4c0f73b94253c74ffb7f1df62c3d88c4a3a884ccb27142020
4
+ data.tar.gz: a72722081d1ca13dd691c9433d658b1bf4917edcc1373a32888cd633e267e198
5
5
  SHA512:
6
- metadata.gz: 19c37134e349976ce49ac2479c79bbdfd112b36195dcf3368abc2744f20cdab2ff1cd73641c32ce76b57d1ed43e6c5fc127af2388970a9d9da3e817e3cf46272
7
- data.tar.gz: 9333b2f27c648e28025931fc1de517ef459ddec5cfefd34dc588bc4d8f4827aabd01292efb441c18a087244ebf130832fc9d441a642de8254173b4e4db633a0e
6
+ metadata.gz: 93255e0ed0e3fe3d395a88353a3e8f1242acf72d833229fa6c2f6515301fbaf0cac06a2a8badcb516262febe2f1ef078f3adfaaa835fe9d36d4857a023093f52
7
+ data.tar.gz: 66b2f9a5a15320b47b4c09e71dece7a9daa4dd192f1863731990b83dcdf705f1b078bbc6405c02ae9c0d55068a5e48284d6f4bc4d9982ca92b65cd6235f6b0a4
@@ -234,20 +234,29 @@ module Dependabot
234
234
  end
235
235
 
236
236
  def post(url, json)
237
- response = Excon.post(
238
- url,
239
- body: json,
240
- user: credentials&.fetch("username", nil),
241
- password: credentials&.fetch("password", nil),
242
- idempotent: true,
243
- **SharedHelpers.excon_defaults(
244
- headers: auth_header.merge(
245
- {
246
- "Content-Type" => "application/json"
247
- }
237
+ response = nil
238
+
239
+ retry_connection_failures do
240
+ response = Excon.post(
241
+ url,
242
+ body: json,
243
+ user: credentials&.fetch("username", nil),
244
+ password: credentials&.fetch("password", nil),
245
+ idempotent: true,
246
+ **SharedHelpers.excon_defaults(
247
+ headers: auth_header.merge(
248
+ {
249
+ "Content-Type" => "application/json"
250
+ }
251
+ )
248
252
  )
249
253
  )
250
- )
254
+
255
+ raise InternalServerError if response.status == 500
256
+ raise BadGateway if response.status == 502
257
+ raise ServiceNotAvailable if response.status == 503
258
+ end
259
+
251
260
  raise NotFound if response.status == 404
252
261
 
253
262
  response
@@ -29,7 +29,7 @@ module Dependabot
29
29
 
30
30
  def initialize(max_retries: 3, **args)
31
31
  @max_retries = max_retries || 3
32
- @client = Bitbucket.new(args)
32
+ @client = Bitbucket.new(**args)
33
33
  end
34
34
 
35
35
  def method_missing(method_name, *args, &block)
@@ -1,12 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "json"
4
- require "tmpdir"
5
- require "excon"
6
- require "English"
7
3
  require "digest"
4
+ require "English"
5
+ require "excon"
6
+ require "fileutils"
7
+ require "json"
8
8
  require "open3"
9
9
  require "shellwords"
10
+ require "tmpdir"
10
11
 
11
12
  require "dependabot/utils"
12
13
  require "dependabot/errors"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dependabot
4
- VERSION = "0.151.1"
4
+ VERSION = "0.154.1"
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.151.1
4
+ version: 0.154.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-07 00:00:00.000000000 Z
11
+ date: 2021-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport