dependabot-common 0.95.69 → 0.95.70
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dependabot/clients/{gitlab.rb → gitlab_with_retries.rb} +25 -7
- data/lib/dependabot/file_fetchers/base.rb +2 -2
- data/lib/dependabot/metadata_finders/base/changelog_finder.rb +2 -2
- data/lib/dependabot/metadata_finders/base/commits_finder.rb +2 -2
- data/lib/dependabot/metadata_finders/base/release_finder.rb +2 -2
- data/lib/dependabot/pull_request_creator/gitlab.rb +6 -5
- data/lib/dependabot/pull_request_creator/message_builder.rb +6 -5
- data/lib/dependabot/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8f743e1cc3f36fc0fa38cdce5d04129d6d099578692222ec10b9cc35c3340f8
|
4
|
+
data.tar.gz: 683afa4dafd9dc4e5b35466ee0dcb8169c0acef36e252850aeb9a1db61162e77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e49592051ae83590e9e8cf31ab9d4665c9f2a345e2839a721e0544c17f1981f22ba5f3676ca95911c7716b6be9f9fa3f39f08f069d0cac0ecaab7ab504a4bee5
|
7
|
+
data.tar.gz: a72551a284a7463c95022436eeb0d19e03d00d3a2abf55d1dd5418425193905b6a446c88cd7f8ae30f928960a90f53710df03ce2d5c0b1475cafd98e9ddab4f7
|
@@ -4,7 +4,11 @@ require "gitlab"
|
|
4
4
|
|
5
5
|
module Dependabot
|
6
6
|
module Clients
|
7
|
-
class
|
7
|
+
class GitlabWithRetries
|
8
|
+
RETRYABLE_ERRORS = [
|
9
|
+
Gitlab::Error::BadGateway
|
10
|
+
].freeze
|
11
|
+
|
8
12
|
#######################
|
9
13
|
# Constructor methods #
|
10
14
|
#######################
|
@@ -51,22 +55,36 @@ module Dependabot
|
|
51
55
|
# Proxying #
|
52
56
|
############
|
53
57
|
|
54
|
-
def initialize(**args)
|
58
|
+
def initialize(max_retries: 3, **args)
|
59
|
+
@max_retries = max_retries || 3
|
55
60
|
@client = ::Gitlab::Client.new(args)
|
56
61
|
end
|
57
62
|
|
58
63
|
def method_missing(method_name, *args, &block)
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
+
retry_connection_failures do
|
65
|
+
if @client.respond_to?(method_name)
|
66
|
+
mutatable_args = args.map(&:dup)
|
67
|
+
@client.public_send(method_name, *mutatable_args, &block)
|
68
|
+
else
|
69
|
+
super
|
70
|
+
end
|
64
71
|
end
|
65
72
|
end
|
66
73
|
|
67
74
|
def respond_to_missing?(method_name, include_private = false)
|
68
75
|
@client.respond_to?(method_name) || super
|
69
76
|
end
|
77
|
+
|
78
|
+
def retry_connection_failures
|
79
|
+
retry_attempt = 0
|
80
|
+
|
81
|
+
begin
|
82
|
+
yield
|
83
|
+
rescue *RETRYABLE_ERRORS
|
84
|
+
retry_attempt += 1
|
85
|
+
retry_attempt <= @max_retries ? retry : raise
|
86
|
+
end
|
87
|
+
end
|
70
88
|
end
|
71
89
|
end
|
72
90
|
end
|
@@ -5,7 +5,7 @@ require "dependabot/source"
|
|
5
5
|
require "dependabot/errors"
|
6
6
|
require "dependabot/clients/github_with_retries"
|
7
7
|
require "dependabot/clients/bitbucket"
|
8
|
-
require "dependabot/clients/
|
8
|
+
require "dependabot/clients/gitlab_with_retries"
|
9
9
|
require "dependabot/shared_helpers"
|
10
10
|
|
11
11
|
# rubocop:disable Metrics/ClassLength
|
@@ -371,7 +371,7 @@ module Dependabot
|
|
371
371
|
|
372
372
|
def gitlab_client
|
373
373
|
@gitlab_client ||=
|
374
|
-
Dependabot::Clients::
|
374
|
+
Dependabot::Clients::GitlabWithRetries.for_source(
|
375
375
|
source: source,
|
376
376
|
credentials: credentials
|
377
377
|
)
|
@@ -4,7 +4,7 @@ require "excon"
|
|
4
4
|
require "pandoc-ruby"
|
5
5
|
|
6
6
|
require "dependabot/clients/github_with_retries"
|
7
|
-
require "dependabot/clients/
|
7
|
+
require "dependabot/clients/gitlab_with_retries"
|
8
8
|
require "dependabot/clients/bitbucket"
|
9
9
|
require "dependabot/shared_helpers"
|
10
10
|
require "dependabot/metadata_finders/base"
|
@@ -337,7 +337,7 @@ module Dependabot
|
|
337
337
|
end
|
338
338
|
|
339
339
|
def gitlab_client
|
340
|
-
@gitlab_client ||= Dependabot::Clients::
|
340
|
+
@gitlab_client ||= Dependabot::Clients::GitlabWithRetries.
|
341
341
|
for_gitlab_dot_com(credentials: credentials)
|
342
342
|
end
|
343
343
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "dependabot/clients/github_with_retries"
|
4
|
-
require "dependabot/clients/
|
4
|
+
require "dependabot/clients/gitlab_with_retries"
|
5
5
|
require "dependabot/clients/bitbucket"
|
6
6
|
require "dependabot/shared_helpers"
|
7
7
|
require "dependabot/git_metadata_fetcher"
|
@@ -249,7 +249,7 @@ module Dependabot
|
|
249
249
|
end
|
250
250
|
|
251
251
|
def gitlab_client
|
252
|
-
@gitlab_client ||= Dependabot::Clients::
|
252
|
+
@gitlab_client ||= Dependabot::Clients::GitlabWithRetries.
|
253
253
|
for_gitlab_dot_com(credentials: credentials)
|
254
254
|
end
|
255
255
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "dependabot/clients/github_with_retries"
|
4
|
-
require "dependabot/clients/
|
4
|
+
require "dependabot/clients/gitlab_with_retries"
|
5
5
|
require "dependabot/metadata_finders/base"
|
6
6
|
require "dependabot/utils"
|
7
7
|
|
@@ -241,7 +241,7 @@ module Dependabot
|
|
241
241
|
end
|
242
242
|
|
243
243
|
def gitlab_client
|
244
|
-
@gitlab_client ||= Dependabot::Clients::
|
244
|
+
@gitlab_client ||= Dependabot::Clients::GitlabWithRetries.
|
245
245
|
for_gitlab_dot_com(credentials: credentials)
|
246
246
|
end
|
247
247
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "dependabot/clients/
|
3
|
+
require "dependabot/clients/gitlab_with_retries"
|
4
4
|
require "dependabot/pull_request_creator"
|
5
5
|
require "gitlab"
|
6
6
|
|
@@ -53,10 +53,11 @@ module Dependabot
|
|
53
53
|
private
|
54
54
|
|
55
55
|
def gitlab_client_for_source
|
56
|
-
@gitlab_client_for_source ||=
|
57
|
-
|
58
|
-
|
59
|
-
|
56
|
+
@gitlab_client_for_source ||=
|
57
|
+
Dependabot::Clients::GitlabWithRetries.for_source(
|
58
|
+
source: source,
|
59
|
+
credentials: credentials
|
60
|
+
)
|
60
61
|
end
|
61
62
|
|
62
63
|
def branch_exists?
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require "pathname"
|
4
4
|
require "dependabot/clients/github_with_retries"
|
5
|
-
require "dependabot/clients/
|
5
|
+
require "dependabot/clients/gitlab_with_retries"
|
6
6
|
require "dependabot/metadata_finders"
|
7
7
|
require "dependabot/pull_request_creator"
|
8
8
|
|
@@ -899,10 +899,11 @@ module Dependabot
|
|
899
899
|
end
|
900
900
|
|
901
901
|
def gitlab_client_for_source
|
902
|
-
@gitlab_client_for_source ||=
|
903
|
-
|
904
|
-
|
905
|
-
|
902
|
+
@gitlab_client_for_source ||=
|
903
|
+
Dependabot::Clients::GitlabWithRetries.for_source(
|
904
|
+
source: source,
|
905
|
+
credentials: credentials
|
906
|
+
)
|
906
907
|
end
|
907
908
|
|
908
909
|
def package_manager
|
data/lib/dependabot/version.rb
CHANGED
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.95.
|
4
|
+
version: 0.95.70
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-ecr
|
@@ -313,7 +313,7 @@ files:
|
|
313
313
|
- lib/dependabot.rb
|
314
314
|
- lib/dependabot/clients/bitbucket.rb
|
315
315
|
- lib/dependabot/clients/github_with_retries.rb
|
316
|
-
- lib/dependabot/clients/
|
316
|
+
- lib/dependabot/clients/gitlab_with_retries.rb
|
317
317
|
- lib/dependabot/dependency.rb
|
318
318
|
- lib/dependabot/dependency_file.rb
|
319
319
|
- lib/dependabot/errors.rb
|