dependabot-maven 0.196.2 → 0.197.0

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: 1d1b693911929ed2f55b3ee70da9d40e1705121b6e996fc7ed7001143b6cf50b
4
- data.tar.gz: d3c071a7cc9abe799abc33ae0820686a6c3acdfdfb0e77f2cbfd9a79e541097c
3
+ metadata.gz: d95fd1b7f6d8f9faa63e1714c9a4f020278487286120ab7ec71691dec548c606
4
+ data.tar.gz: 6ad860384f9e1644a70c392cc0a9cd02bb9a4a51d2be4061d4a788cc0d26b097
5
5
  SHA512:
6
- metadata.gz: a9b88bd4b11b5b6bd32bd8ec5414d8484f0ace8d4927146128a6dcaff1211ea12cebe8d58ddb161e257f7f677f5f511ed570e497e40048ade89054916cffa3e1
7
- data.tar.gz: b86732e246d75e5fbb21d9a7c45ca9c78853f50a381c3734b303a6ab3745a5604adb32fb08581051488702128d5fdf6881c0d368f12e50184e1b02e9d8004ac9
6
+ metadata.gz: 89a786559c9522377cad398849b7dec0e03c7bbcf28c2da35a89ff2297ff32ce30a93b19565dbe3be6f38a4b6dfc74eb752e65a47934ebea9e5581ce39d9e8a2
7
+ data.tar.gz: 2bfa937a4b4b76e8a322df8caa564c5f2db592e1876e35afbbd146c7641f125780441569ef74f1a992231be3edf9eb340ffd8bc1c940d4d08851cc2d52144ee4
@@ -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.2
4
+ version: 0.197.0
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-29 00:00:00.000000000 Z
11
+ date: 2022-07-15 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.2
19
+ version: 0.197.0
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.2
26
+ version: 0.197.0
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