dependabot-bundler 0.254.0 → 0.255.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: cc5a16c08592e9c9fa5d20dbca8c0fcd139d2f59c5ae232ba96b68d2bf3131b1
4
- data.tar.gz: 4b201b8e911ddf12fd8024a41cf41028ca91547f95ecb59675c2fc07f5d9feb9
3
+ metadata.gz: a5ed4679981b1dfbe38f4e9f52c81a010f53d6fde18b8cacaf7ce2df5d5d2903
4
+ data.tar.gz: 0f8dda3c38efa64636e65130a8a51b5e2cbd388ddf1261df69447c5f76b2f073
5
5
  SHA512:
6
- metadata.gz: 1d7ee9a2b8de58ee7ff673e644cc8610e62685a510cc21070709fd24210065b4d1c5e0ee44cfe86cba6e1a70cde25b540cacdfd0a66db7ad4a60a5ddf82cecda
7
- data.tar.gz: 1145d137c82464825be919d16fb9c18bf88cab1b521506ea97c2e9ee547e783a2ee8b210d7124d91fbf31d01cea2622ff8d42c21d9a704deff498c44df98765c
6
+ metadata.gz: 5bfded8fc81c2d7cdafdbbfe94f945e2cfe715ea0a7081bb44f9a4390a9f89f75e740d5faea1ca917f7f006675e77d544b3dd796bf6fa9d13254a86be171cff9
7
+ data.tar.gz: 28db82c001cb2ece09d732cc5460301d4ed59ff4455fbc0a1ca10129d17c021ce4a560222d00706dba08d45fa442b81c694147f9fca0276a54fb73a421856cdb
@@ -0,0 +1,239 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ require "rubygems/vendored_net_http"
5
+
6
+ module WebMock
7
+ module HttpLibAdapters
8
+ class GemNetHttpAdapter < HttpLibAdapter
9
+ adapter_for :gem_net_http
10
+
11
+ OriginalGemNetHTTP = ::Gem::Net::HTTP unless const_defined?(:OriginalGemNetHTTP)
12
+
13
+ def self.enable!
14
+ ::Gem::Net.send(:remove_const, :HTTP)
15
+ ::Gem::Net.send(:remove_const, :HTTPSession)
16
+ ::Gem::Net.send(:const_set, :HTTP, @webMockNetHTTP)
17
+ ::Gem::Net.send(:const_set, :HTTPSession, @webMockNetHTTP)
18
+ end
19
+
20
+ def self.disable!
21
+ ::Gem::Net.send(:remove_const, :HTTP)
22
+ ::Gem::Net.send(:remove_const, :HTTPSession)
23
+ ::Gem::Net.send(:const_set, :HTTP, OriginalGemNetHTTP)
24
+ ::Gem::Net.send(:const_set, :HTTPSession, OriginalGemNetHTTP)
25
+
26
+ # copy all constants from @webMockNetHTTP to original Net::HTTP
27
+ # in case any constants were added to @webMockNetHTTP instead of Net::HTTP
28
+ # after WebMock was enabled.
29
+ # i.e Net::HTTP::DigestAuth
30
+ @webMockNetHTTP.constants.each do |constant|
31
+ unless OriginalGemNetHTTP.constants.map(&:to_s).include?(constant.to_s)
32
+ OriginalGemNetHTTP.send(:const_set, constant, @webMockNetHTTP.const_get(constant))
33
+ end
34
+ end
35
+ end
36
+
37
+ @webMockNetHTTP = Class.new(::Gem::Net::HTTP) do
38
+ class << self
39
+ def socket_type
40
+ StubSocket
41
+ end
42
+
43
+ if Module.method(:const_defined?).arity == 1
44
+ def const_defined?(name)
45
+ super || superclass.const_defined?(name)
46
+ end
47
+ else
48
+ def const_defined?(name, inherit = true)
49
+ super || superclass.const_defined?(name, inherit)
50
+ end
51
+ end
52
+
53
+ if Module.method(:const_get).arity != 1
54
+ def const_get(name, inherit = true)
55
+ super
56
+ rescue NameError
57
+ superclass.const_get(name, inherit)
58
+ end
59
+ end
60
+
61
+ if Module.method(:constants).arity != 0
62
+ def constants(inherit = true)
63
+ (super + superclass.constants(inherit)).uniq
64
+ end
65
+ end
66
+ end
67
+
68
+ def request(request, body = nil, &block)
69
+ request_signature = WebMock::NetHTTPUtility.request_signature_from_request(self, request, body)
70
+
71
+ WebMock::RequestRegistry.instance.requested_signatures.put(request_signature)
72
+
73
+ if webmock_response = WebMock::StubRegistry.instance.response_for_request(request_signature)
74
+ @socket = ::Gem::Net::HTTP.socket_type.new
75
+ WebMock::CallbackRegistry.invoke_callbacks(
76
+ { lib: :net_http }, request_signature, webmock_response
77
+ )
78
+ build_net_http_response(webmock_response, request.uri, &block)
79
+ elsif WebMock.net_connect_allowed?(request_signature.uri)
80
+ check_right_http_connection
81
+ after_request = lambda do |response|
82
+ if WebMock::CallbackRegistry.any_callbacks?
83
+ webmock_response = build_webmock_response(response)
84
+ WebMock::CallbackRegistry.invoke_callbacks(
85
+ { lib: :net_http, real_request: true }, request_signature, webmock_response
86
+ )
87
+ end
88
+ response.extend Net::WebMockHTTPResponse
89
+ yield response if block
90
+ response
91
+ end
92
+ super_with_after_request = lambda {
93
+ response = super(request, nil, &nil)
94
+ after_request.call(response)
95
+ }
96
+ if started?
97
+ ensure_actual_connection
98
+ super_with_after_request.call
99
+ else
100
+ start_with_connect do
101
+ super_with_after_request.call
102
+ end
103
+ end
104
+ else
105
+ raise WebMock::NetConnectNotAllowedError.new(request_signature)
106
+ end
107
+ end
108
+
109
+ def start_without_connect
110
+ raise IOError, "HTTP session already opened" if @started
111
+
112
+ if block_given?
113
+ begin
114
+ @socket = ::Gem::Net::HTTP.socket_type.new
115
+ @started = true
116
+ return yield(self)
117
+ ensure
118
+ do_finish
119
+ end
120
+ end
121
+ @socket = ::Gem::Net::HTTP.socket_type.new
122
+ @started = true
123
+ self
124
+ end
125
+
126
+ def ensure_actual_connection
127
+ return unless @socket.is_a?(StubSocket)
128
+
129
+ @socket&.close
130
+ @socket = nil
131
+ do_start
132
+ end
133
+
134
+ alias_method :start_with_connect, :start
135
+
136
+ def start(&block)
137
+ uri = Addressable::URI.parse(WebMock::NetHTTPUtility.get_uri(self))
138
+
139
+ if WebMock.net_http_connect_on_start?(uri)
140
+ super(&block)
141
+ else
142
+ start_without_connect(&block)
143
+ end
144
+ end
145
+
146
+ def build_net_http_response(webmock_response, request_uri)
147
+ response = ::Gem::Net::HTTPResponse.send(:response_class, webmock_response.status[0].to_s).new("1.0",
148
+ webmock_response.status[0].to_s, webmock_response.status[1])
149
+ body = webmock_response.body
150
+ body = nil if webmock_response.status[0].to_s == "204"
151
+
152
+ response.instance_variable_set(:@body, body)
153
+ webmock_response.headers.to_a.each do |name, values|
154
+ values = [values] unless values.is_a?(Array)
155
+ values.each do |value|
156
+ response.add_field(name, value)
157
+ end
158
+ end
159
+
160
+ response.instance_variable_set(:@read, true)
161
+
162
+ response.uri = request_uri
163
+
164
+ response.extend Net::WebMockHTTPResponse
165
+
166
+ raise Net::OpenTimeout, "execution expired" if webmock_response.should_timeout
167
+
168
+ webmock_response.raise_error_if_any
169
+
170
+ yield response if block_given?
171
+
172
+ response
173
+ end
174
+
175
+ def build_webmock_response(net_http_response)
176
+ webmock_response = WebMock::Response.new
177
+ webmock_response.status = [
178
+ net_http_response.code.to_i,
179
+ net_http_response.message
180
+ ]
181
+ webmock_response.headers = net_http_response.to_hash
182
+ webmock_response.body = net_http_response.body
183
+ webmock_response
184
+ end
185
+
186
+ def check_right_http_connection
187
+ return if @@alredy_checked_for_right_http_connection ||= false
188
+
189
+ WebMock::NetHTTPUtility.puts_warning_for_right_http_if_needed
190
+ @@alredy_checked_for_right_http_connection = true
191
+ end
192
+ end
193
+ @webMockNetHTTP.version_1_2
194
+ [
195
+ [:Get, ::Gem::Net::HTTP::Get],
196
+ [:Post, ::Gem::Net::HTTP::Post],
197
+ [:Put, ::Gem::Net::HTTP::Put],
198
+ [:Delete, ::Gem::Net::HTTP::Delete],
199
+ [:Head, ::Gem::Net::HTTP::Head],
200
+ [:Options, ::Gem::Net::HTTP::Options]
201
+ ].each do |c|
202
+ @webMockNetHTTP.const_set(c[0], c[1])
203
+ end
204
+ end
205
+ end
206
+
207
+ class StubSocket # :nodoc:
208
+ attr_accessor :read_timeout
209
+ attr_accessor :continue_timeout
210
+ attr_accessor :write_timeout
211
+
212
+ def initialize(*_args)
213
+ @closed = false
214
+ end
215
+
216
+ def closed?
217
+ @closed
218
+ end
219
+
220
+ def close
221
+ @closed = true
222
+ nil
223
+ end
224
+
225
+ def readuntil(*args); end
226
+
227
+ def io
228
+ @io ||= StubIO.new
229
+ end
230
+
231
+ class StubIO
232
+ def setsockopt(*args); end
233
+ def peer_cert; end
234
+ def peeraddr = ["AF_INET", 443, "127.0.0.1", "127.0.0.1"]
235
+ def ssl_version = "TLSv1.3"
236
+ def cipher = ["TLS_AES_128_GCM_SHA256", "TLSv1.3", 128, 128]
237
+ end
238
+ end
239
+ end
data/helpers/v1/build CHANGED
@@ -14,6 +14,7 @@ else
14
14
  "$helpers_dir/lib" \
15
15
  "$helpers_dir/monkey_patches" \
16
16
  "$helpers_dir/run.rb" \
17
+ "$helpers_dir/patched_bundler" \
17
18
  "$install_dir"
18
19
  fi
19
20
 
@@ -24,5 +25,5 @@ export GEM_HOME=$install_dir/.bundle
24
25
  gem install bundler -v 1.17.3 --no-document
25
26
 
26
27
  if [ -z "$DEPENDABOT_NATIVE_HELPERS_PATH" ]; then
27
- BUNDLER_VERSION=1.17.3 bundle install
28
+ BUNDLER_VERSION=1.17.3 ./patched_bundler install
28
29
  fi
@@ -12,7 +12,7 @@ module BundlerDefinitionRubyVersionPatch
12
12
  Gem::Specification.new("ruby\0", requested_version)
13
13
  end
14
14
 
15
- %w(2.5.3p105 2.6.10p210 2.7.6p219 3.0.4p208).each do |version|
15
+ %w(2.5.3p105 2.6.10p210 2.7.6p219 3.0.7p220 3.1.5p252 3.2.4p170).each do |version|
16
16
  sources.metadata_source.specs << Gem::Specification.new("ruby\0", version)
17
17
  end
18
18
  end
@@ -15,7 +15,7 @@ module Bundler
15
15
  def configured_uri_for(uri)
16
16
  uri = uri.gsub(%r{git@(.*?):/?}, 'https://\1/')
17
17
  if uri.match?(/https?:/)
18
- remote = URI(uri)
18
+ remote = ::URI.parse(uri)
19
19
  config_auth =
20
20
  Bundler.settings[remote.to_s] || Bundler.settings[remote.host]
21
21
  remote.userinfo ||= config_auth
@@ -0,0 +1,17 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ # Bundler v1 uses the `untaint` method on objects in `Bundler::SharedHelpers`.
5
+ # This method has been deprecated for a long time, and is actually a no-op in
6
+ # ruby versions 2.7+. In Ruby 3.3 it was finally removed, and it's now causing
7
+ # bundler v1 to error.
8
+ #
9
+ # In order to keep the old behavior, we're monkey patching `Object` to add a
10
+ # no-op implementation of untaint.
11
+ module ObjectUntaintPatch
12
+ def untaint
13
+ self
14
+ end
15
+ end
16
+
17
+ Object.prepend(ObjectUntaintPatch)
@@ -0,0 +1,34 @@
1
+ #!/usr/local/bin/ruby
2
+ #
3
+ # This file was generated by RubyGems.
4
+ # It was then patched by Dependabot to add `Object#untaint` back
5
+ # in order to run bundler 1.17.3 using Ruby 3.3+.
6
+ #
7
+ # The application 'bundler' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ $LOAD_PATH.unshift(File.expand_path("./monkey_patches", __dir__))
12
+ require "object_untaint_patch"
13
+
14
+ require 'rubygems'
15
+
16
+ version = ">= 0.a"
17
+
18
+ str = ARGV.first
19
+ if str
20
+ str = str.b[/\A_(.*)_\z/, 1]
21
+ if str and Gem::Version.correct?(str)
22
+ version = str
23
+ ENV['BUNDLER_VERSION'] = str
24
+
25
+ ARGV.shift
26
+ end
27
+ end
28
+
29
+ if Gem.respond_to?(:activate_bin_path)
30
+ load Gem.activate_bin_path('bundler', 'bundle', version)
31
+ else
32
+ gem "bundler", version
33
+ load Gem.bin_path("bundler", "bundle", version)
34
+ end
data/helpers/v1/run.rb CHANGED
@@ -19,6 +19,7 @@ require "definition_bundler_version_patch"
19
19
  require "fileutils_keyword_splat_patch"
20
20
  require "git_source_patch"
21
21
  require "resolver_spec_group_sane_eql"
22
+ require "object_untaint_patch"
22
23
 
23
24
  require "functions"
24
25
 
@@ -7,6 +7,7 @@ require "tmpdir"
7
7
 
8
8
  $LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
9
9
  $LOAD_PATH.unshift(File.expand_path("../monkey_patches", __dir__))
10
+ $LOAD_PATH.unshift(File.expand_path("../../spec_helpers", __dir__))
10
11
 
11
12
  # Bundler monkey patches
12
13
  require "definition_ruby_version_patch"
@@ -17,6 +18,8 @@ require "resolver_spec_group_sane_eql"
17
18
 
18
19
  require "functions"
19
20
 
21
+ require "gem_net_http_adapter"
22
+
20
23
  RSpec.configure do |config|
21
24
  config.color = true
22
25
  config.order = :rand
@@ -26,7 +26,7 @@ module BundlerDefinitionRubyVersionPatch
26
26
  Gem::Specification.new("Ruby\0", requested_version)
27
27
  end
28
28
 
29
- %w(2.5.3 2.6.10 2.7.7 3.0.5 3.2.1).each do |version|
29
+ %w(2.5.3 2.6.10 2.7.8 3.0.7 3.1.5 3.2.4).each do |version|
30
30
  sources.metadata_source.specs << Gem::Specification.new("Ruby\0", version)
31
31
  end
32
32
 
@@ -19,7 +19,7 @@ module Bundler
19
19
  def configured_uri_for(uri)
20
20
  uri = uri.gsub(%r{git@(.*?):/?}, 'https://\1/')
21
21
  if /https?:/.match?(uri)
22
- remote = Bundler::URI(uri)
22
+ remote = ::URI.parse(uri)
23
23
  config_auth = Bundler.settings[remote.to_s] || Bundler.settings[remote.host]
24
24
  remote.userinfo ||= config_auth
25
25
  remote.to_s
@@ -7,6 +7,7 @@ require "debug"
7
7
 
8
8
  $LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
9
9
  $LOAD_PATH.unshift(File.expand_path("../monkey_patches", __dir__))
10
+ $LOAD_PATH.unshift(File.expand_path("../../spec_helpers", __dir__))
10
11
 
11
12
  # Bundler monkey patches
12
13
  require "definition_ruby_version_patch"
@@ -15,6 +16,8 @@ require "git_source_patch"
15
16
 
16
17
  require "functions"
17
18
 
19
+ require "gem_net_http_adapter"
20
+
18
21
  RSpec.configure do |config|
19
22
  config.color = true
20
23
  config.order = :rand
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.254.0
4
+ version: 0.255.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-24 00:00:00.000000000 Z
11
+ date: 2024-05-03 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.254.0
19
+ version: 0.255.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.254.0
26
+ version: 0.255.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: parallel
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -178,6 +178,20 @@ dependencies:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
180
  version: 0.8.1
181
+ - !ruby/object:Gem::Dependency
182
+ name: simplecov
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: 0.22.0
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: 0.22.0
181
195
  - !ruby/object:Gem::Dependency
182
196
  name: turbo_tests
183
197
  requirement: !ruby/object:Gem::Requirement
@@ -242,6 +256,7 @@ executables: []
242
256
  extensions: []
243
257
  extra_rdoc_files: []
244
258
  files:
259
+ - helpers/spec_helpers/gem_net_http_adapter.rb
245
260
  - helpers/v1/.gitignore
246
261
  - helpers/v1/Gemfile
247
262
  - helpers/v1/build
@@ -256,7 +271,9 @@ files:
256
271
  - helpers/v1/monkey_patches/definition_ruby_version_patch.rb
257
272
  - helpers/v1/monkey_patches/fileutils_keyword_splat_patch.rb
258
273
  - helpers/v1/monkey_patches/git_source_patch.rb
274
+ - helpers/v1/monkey_patches/object_untaint_patch.rb
259
275
  - helpers/v1/monkey_patches/resolver_spec_group_sane_eql.rb
276
+ - helpers/v1/patched_bundler
260
277
  - helpers/v1/run.rb
261
278
  - helpers/v1/spec/functions/conflicting_dependency_resolver_spec.rb
262
279
  - helpers/v1/spec/functions/dependency_source_spec.rb
@@ -328,7 +345,7 @@ licenses:
328
345
  - Nonstandard
329
346
  metadata:
330
347
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
331
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.254.0
348
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.255.0
332
349
  post_install_message:
333
350
  rdoc_options: []
334
351
  require_paths:
@@ -344,7 +361,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
344
361
  - !ruby/object:Gem::Version
345
362
  version: 3.1.0
346
363
  requirements: []
347
- rubygems_version: 3.3.26
364
+ rubygems_version: 3.5.9
348
365
  signing_key:
349
366
  specification_version: 4
350
367
  summary: Provides Dependabot support for Ruby (bundler)