dependabot-maven 0.196.1 → 0.196.4

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: 4feb559b29011faf533d52b218ebb1b13705fe225775c7a4a1472f7607656a8d
4
- data.tar.gz: e9969f9f1854a58bd2b878622adc22fbcbca16b2686595fc46619b6b96799e70
3
+ metadata.gz: 9f943486183cfc1341852eff617b0c57f24b0e72709b42fd6bcaeceea7d15a10
4
+ data.tar.gz: e99f8aaa6210d38802d1edddaf8965cdf66762bb246d11a1dabb39a3df6d8d01
5
5
  SHA512:
6
- metadata.gz: 5753eaa37a174fca51a9d5a9a9c9d0b0056b6d88d3ef6c80c9f3b45ea401bb4d6d5efe7cae6e9e9ce3c4a7aa16a1e2bcd42bc2554be67ada1630848cd5438077
7
- data.tar.gz: 2f3d7a96b6ad3daa6f62563cf3347eb831be8ea3dc0d67043814809b318f1e410ab0fdb1f172709677eeb0ed6f02387d5e4cda749cf8cce3356495697dbfed59
6
+ metadata.gz: e81de9f967930d5690d8f1eb6e5aaf7e815592f0688ef572958dd8a4f6c4c1b251e202c792bbc43c7dc1d60caf318274aa2b8d3029aaaa4a87004720ae6f2bb4
7
+ data.tar.gz: e8fc60ffd7d55731ed5ece553d8f0073740db3ac89929171ce3d968680e0a9ecb6a24adfac7b6d5e9c79f873a97c41b8f84f57733a5cb82fec2aedf587cabdb5
@@ -4,6 +4,7 @@ require "nokogiri"
4
4
 
5
5
  require "dependabot/dependency_file"
6
6
  require "dependabot/maven/file_parser"
7
+ require "dependabot/registry_client"
7
8
 
8
9
  # For documentation, see:
9
10
  # - http://maven.apache.org/guides/introduction/introduction-to-the-pom.html
@@ -127,7 +128,7 @@ module Dependabot
127
128
  url = remote_pom_url(group_id, artifact_id, version, base_url)
128
129
 
129
130
  @maven_responses ||= {}
130
- @maven_responses[url] ||= RegistryClient.get(url: url)
131
+ @maven_responses[url] ||= Dependabot::RegistryClient.get(url: url)
131
132
  next unless @maven_responses[url].status == 200
132
133
  next unless pom?(@maven_responses[url].body)
133
134
 
@@ -4,6 +4,7 @@ require "nokogiri"
4
4
 
5
5
  require "dependabot/dependency_file"
6
6
  require "dependabot/maven/file_parser"
7
+ require "dependabot/registry_client"
7
8
  require "dependabot/errors"
8
9
 
9
10
  # For documentation, see:
@@ -109,7 +110,7 @@ module Dependabot
109
110
  url = remote_pom_url(group_id, artifact_id, version, base_url)
110
111
 
111
112
  @maven_responses ||= {}
112
- @maven_responses[url] ||= RegistryClient.get(
113
+ @maven_responses[url] ||= Dependabot::RegistryClient.get(
113
114
  url: url,
114
115
  # We attempt to find dependencies in private repos before failing over to the CENTRAL_REPO_URL,
115
116
  # but this can burn a lot of a job's time against slow servers due to our `read_timeout` being 20 seconds.
@@ -7,6 +7,7 @@ require "dependabot/file_fetchers/base"
7
7
  require "dependabot/maven/file_parser"
8
8
  require "dependabot/maven/file_parser/repositories_finder"
9
9
  require "dependabot/maven/utils/auth_headers_finder"
10
+ require "dependabot/registry_client"
10
11
 
11
12
  module Dependabot
12
13
  module Maven
@@ -104,7 +105,7 @@ module Dependabot
104
105
  def dependency_pom_file
105
106
  return @dependency_pom_file unless @dependency_pom_file.nil?
106
107
 
107
- response = RegistryClient.get(
108
+ response = Dependabot::RegistryClient.get(
108
109
  url: "#{maven_repo_dependency_url}/#{dependency.version}/#{dependency_artifact_id}-#{dependency.version}.pom",
109
110
  headers: auth_headers
110
111
  )
@@ -134,7 +135,7 @@ module Dependabot
134
135
  "#{version}/"\
135
136
  "#{artifact_id}-#{version}.pom"
136
137
 
137
- response = RegistryClient.get(
138
+ response = Dependabot::RegistryClient.get(
138
139
  url: substitute_properties_in_source_url(url, pom),
139
140
  headers: auth_headers
140
141
  )
@@ -7,6 +7,7 @@ require "dependabot/maven/update_checker"
7
7
  require "dependabot/maven/version"
8
8
  require "dependabot/maven/requirement"
9
9
  require "dependabot/maven/utils/auth_headers_finder"
10
+ require "dependabot/registry_client"
10
11
 
11
12
  module Dependabot
12
13
  module Maven
@@ -138,7 +139,7 @@ module Dependabot
138
139
  @released_check[version] =
139
140
  repositories.any? do |repository_details|
140
141
  url = repository_details.fetch("url")
141
- response = RegistryClient.head(
142
+ response = Dependabot::RegistryClient.head(
142
143
  url: dependency_files_url(url, version),
143
144
  headers: repository_details.fetch("auth_headers")
144
145
  )
@@ -160,7 +161,7 @@ module Dependabot
160
161
  end
161
162
 
162
163
  def fetch_dependency_metadata(repository_details)
163
- response = RegistryClient.get(
164
+ response = Dependabot::RegistryClient.get(
164
165
  url: dependency_metadata_url(repository_details.fetch("url")),
165
166
  headers: repository_details.fetch("auth_headers")
166
167
  )
@@ -9,7 +9,6 @@ require "dependabot/maven/file_updater"
9
9
  require "dependabot/maven/metadata_finder"
10
10
  require "dependabot/maven/requirement"
11
11
  require "dependabot/maven/version"
12
- require "dependabot/maven/registry_client"
13
12
 
14
13
  require "dependabot/pull_request_creator/labeler"
15
14
  Dependabot::PullRequestCreator::Labeler.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-maven
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.196.1
4
+ version: 0.196.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-27 00:00:00.000000000 Z
11
+ date: 2022-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dependabot-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.196.1
19
+ version: 0.196.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.196.1
26
+ version: 0.196.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debase
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 1.30.1
131
+ version: 1.31.2
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 1.30.1
138
+ version: 1.31.2
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: ruby-debug-ide
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -236,7 +236,6 @@ files:
236
236
  - lib/dependabot/maven/file_updater/declaration_finder.rb
237
237
  - lib/dependabot/maven/file_updater/property_value_updater.rb
238
238
  - lib/dependabot/maven/metadata_finder.rb
239
- - lib/dependabot/maven/registry_client.rb
240
239
  - lib/dependabot/maven/requirement.rb
241
240
  - lib/dependabot/maven/update_checker.rb
242
241
  - lib/dependabot/maven/update_checker/property_updater.rb
@@ -1,57 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "dependabot/shared_helpers"
4
-
5
- # This class provides a thin wrapper around our normal usage of Excon as a simple HTTP client in order to
6
- # provide some minor caching functionality.
7
- #
8
- # This is not used to support full response caching currently, we just use it to ensure we detect unreachable
9
- # hosts and fast-fail on any subsequent requests to them to avoid excessive use of retries and connect- or
10
- # read-timeouts as Maven jobs tend to be sensitive to exceeding our overall 45 minute timeout.
11
- module Dependabot
12
- module Maven
13
- class RegistryClient
14
- @cached_errors = {}
15
-
16
- def self.get(url:, headers: {}, options: {})
17
- raise cached_error_for(url) if cached_error_for(url)
18
-
19
- Excon.get(
20
- url,
21
- idempotent: true,
22
- **SharedHelpers.excon_defaults({ headers: headers }.merge(options))
23
- )
24
- rescue Excon::Error::Timeout => e
25
- cache_error(url, e)
26
- raise e
27
- end
28
-
29
- def self.head(url:, headers: {}, options: {})
30
- raise cached_error_for(url) if cached_error_for(url)
31
-
32
- Excon.head(
33
- url,
34
- idempotent: true,
35
- **SharedHelpers.excon_defaults({ headers: headers }.merge(options))
36
- )
37
- rescue Excon::Error::Timeout => e
38
- cache_error(url, e)
39
- raise e
40
- end
41
-
42
- def self.clear_cache!
43
- @cached_errors = {}
44
- end
45
-
46
- private_class_method def self.cache_error(url, error)
47
- host = URI(url).host
48
- @cached_errors[host] = error
49
- end
50
-
51
- private_class_method def self.cached_error_for(url)
52
- host = URI(url).host
53
- @cached_errors.fetch(host, nil)
54
- end
55
- end
56
- end
57
- end