elastic-transport 8.3.5 → 8.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/elastic/transport/transport/base.rb +7 -3
- data/lib/elastic/transport/transport/errors.rb +2 -0
- data/lib/elastic/transport/transport/http/curb.rb +13 -9
- data/lib/elastic/transport/transport/http/manticore.rb +7 -5
- data/lib/elastic/transport/transport/serializer/multi_json.rb +16 -2
- data/lib/elastic/transport/transport/sniffer.rb +2 -0
- data/lib/elastic/transport/version.rb +1 -1
- data/lib/elastic/transport.rb +0 -1
- metadata +9 -82
- data/.github/check_license_headers.rb +0 -33
- data/.github/license-header.txt +0 -16
- data/.github/workflows/license.yml +0 -13
- data/.github/workflows/otel.yml +0 -48
- data/.github/workflows/tests.yml +0 -85
- data/.gitignore +0 -19
- data/Gemfile +0 -36
- data/Gemfile-faraday1.gemfile +0 -40
- data/Rakefile +0 -133
- data/elastic-transport.gemspec +0 -71
- data/spec/elastic/connections/collection_spec.rb +0 -266
- data/spec/elastic/connections/selector_spec.rb +0 -166
- data/spec/elastic/transport/base_spec.rb +0 -265
- data/spec/elastic/transport/client_spec.rb +0 -1772
- data/spec/elastic/transport/http/curb_spec.rb +0 -126
- data/spec/elastic/transport/http/faraday_spec.rb +0 -141
- data/spec/elastic/transport/http/manticore_spec.rb +0 -164
- data/spec/elastic/transport/meta_header_spec.rb +0 -289
- data/spec/elastic/transport/opentelemetry_spec.rb +0 -325
- data/spec/elastic/transport/sniffer_spec.rb +0 -293
- data/spec/spec_helper.rb +0 -105
- data/test/integration/jruby_test.rb +0 -46
- data/test/integration/transport_test.rb +0 -144
- data/test/profile/client_benchmark_test.rb +0 -132
- data/test/test_helper.rb +0 -86
- data/test/unit/adapters_test.rb +0 -88
- data/test/unit/connection_test.rb +0 -133
- data/test/unit/response_test.rb +0 -30
- data/test/unit/serializer_test.rb +0 -33
- data/test/unit/transport_base_test.rb +0 -663
- data/test/unit/transport_curb_test.rb +0 -134
- data/test/unit/transport_faraday_test.rb +0 -228
- data/test/unit/transport_manticore_test.rb +0 -268
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6c74ecb8b5f87503b024bd292d35e9f090d5de7cb4974354af36b566f9866b2f
|
|
4
|
+
data.tar.gz: fab6e1f899769073a83692e677be0904c819c4660f4d21908ed6068f0eb5d774
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d79595ce41082119444253c1ea940e81ce4beef9c80c7ec7e7b9b7f780f514ffd1ac264455bea49616fa064d2b69c95a1f5977edd93c63ea19cfd5a4c6117d5
|
|
7
|
+
data.tar.gz: 3c10b49555b514cac6d7c8fe7638d5047e8636114e089e2354032cf39af088247fb0661fb0fae1199c87a59df772991961188df91006912c7b7920ee5d0394a6
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## 8.3.7
|
|
2
|
+
|
|
3
|
+
- Minor refactor to `curb` implementation.
|
|
4
|
+
- Updated `yard` development dependency to `> 0.9.42`.
|
|
5
|
+
- Fix `multi_json` deprecation warnings. Some deprecations [were introduced in `multi_json` 1.21.0](https://github.com/sferik/multi_json/blob/main/CHANGELOG.md#1210). Pull Request: [#112](https://github.com/elastic/elastic-transport-ruby/pull/112).
|
|
6
|
+
- Reduced gem size. Pull Request: [#114](https://github.com/elastic/elastic-transport-ruby/pull/114).
|
|
7
|
+
- Addresses duplicate `content-type` header in Manticore. Pull Request: [#115](https://github.com/elastic/elastic-transport-ruby/pull/115).
|
|
8
|
+
|
|
9
|
+
## 8.3.6
|
|
10
|
+
|
|
11
|
+
- Moves `require 'timeout'` to the classes that use it. Closed [#79](https://github.com/elastic/elastic-transport-ruby/issues/79).
|
|
12
|
+
- Sanitize url on OTEL spans, thanks @steve21168. Pull Request: [#98](https://github.com/elastic/elastic-transport-ruby/pull/98)
|
|
13
|
+
|
|
1
14
|
## 8.3.5
|
|
2
15
|
|
|
3
16
|
- Small updates in source code documentation.
|
|
@@ -195,7 +195,7 @@ module Elastic
|
|
|
195
195
|
#
|
|
196
196
|
def __log_response(method, path, params, body, url, response, json, took, duration)
|
|
197
197
|
if logger
|
|
198
|
-
sanitized_url = url.to_s
|
|
198
|
+
sanitized_url = sanitize_url(url.to_s)
|
|
199
199
|
log_info "#{method.to_s.upcase} #{sanitized_url} " +
|
|
200
200
|
"[status:#{response.status}, request:#{sprintf('%.3fs', duration)}, query:#{took}]"
|
|
201
201
|
log_debug "> #{__convert_to_json(body)}" if body
|
|
@@ -383,7 +383,7 @@ module Elastic
|
|
|
383
383
|
ACCEPT_ENCODING = 'Accept-Encoding'.freeze
|
|
384
384
|
CONTENT_ENCODING = 'Content-Encoding'.freeze
|
|
385
385
|
CONTENT_TYPE_STR = 'Content-Type'.freeze
|
|
386
|
-
CONTENT_TYPE_REGEX = /content-?_?type/
|
|
386
|
+
CONTENT_TYPE_REGEX = /content-?_?type/i.freeze
|
|
387
387
|
DEFAULT_CONTENT_TYPE = 'application/json'.freeze
|
|
388
388
|
GZIP = 'gzip'.freeze
|
|
389
389
|
GZIP_FIRST_TWO_BYTES = '1f8b'.freeze
|
|
@@ -472,9 +472,13 @@ module Elastic
|
|
|
472
472
|
end
|
|
473
473
|
end
|
|
474
474
|
|
|
475
|
+
def sanitize_url(url)
|
|
476
|
+
url.to_s.gsub(/\/\/(.+):(.+)@/, '//' + '\1:' + SANITIZED_PASSWORD + '@')
|
|
477
|
+
end
|
|
478
|
+
|
|
475
479
|
def capture_otel_span_attributes(connection, url)
|
|
476
480
|
if defined?(::OpenTelemetry)
|
|
477
|
-
::OpenTelemetry::Trace.current_span&.set_attribute('url.full', url)
|
|
481
|
+
::OpenTelemetry::Trace.current_span&.set_attribute('url.full', sanitize_url(url))
|
|
478
482
|
::OpenTelemetry::Trace.current_span&.set_attribute('server.address', connection.host[:host])
|
|
479
483
|
::OpenTelemetry::Trace.current_span&.set_attribute('server.port', connection.host[:port].to_i)
|
|
480
484
|
end
|
|
@@ -43,15 +43,7 @@ module Elastic
|
|
|
43
43
|
when 'GET', 'POST', 'PUT', 'DELETE'
|
|
44
44
|
connection.connection.set :nobody, false
|
|
45
45
|
connection.connection.put_data = body if body
|
|
46
|
-
|
|
47
|
-
if headers
|
|
48
|
-
if connection.connection.headers
|
|
49
|
-
connection.connection.headers.merge!(headers)
|
|
50
|
-
else
|
|
51
|
-
connection.connection.headers = headers
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
|
|
46
|
+
parse_headers!(headers, connection)
|
|
55
47
|
else raise ArgumentError, "Unsupported HTTP method: #{method}"
|
|
56
48
|
end
|
|
57
49
|
|
|
@@ -69,6 +61,18 @@ module Elastic
|
|
|
69
61
|
end
|
|
70
62
|
end
|
|
71
63
|
|
|
64
|
+
# Merges headers already present in the connection and the ones passed in to perform_request
|
|
65
|
+
#
|
|
66
|
+
def parse_headers!(headers, connection)
|
|
67
|
+
return unless headers
|
|
68
|
+
|
|
69
|
+
if connection.connection.headers
|
|
70
|
+
connection.connection.headers.merge!(headers)
|
|
71
|
+
else
|
|
72
|
+
connection.connection.headers = headers
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
72
76
|
# Builds and returns a connection
|
|
73
77
|
#
|
|
74
78
|
# @return [Connections::Connection]
|
|
@@ -64,11 +64,10 @@ module Elastic
|
|
|
64
64
|
|
|
65
65
|
def initialize(arguments = {}, &block)
|
|
66
66
|
@request_options = {
|
|
67
|
-
headers:
|
|
67
|
+
headers:
|
|
68
68
|
arguments.dig(:transport_options, :headers) ||
|
|
69
69
|
arguments.dig(:options, :transport_options, :headers) ||
|
|
70
70
|
{}
|
|
71
|
-
)
|
|
72
71
|
}
|
|
73
72
|
@manticore = build_client(arguments[:options] || {})
|
|
74
73
|
super(arguments, &block)
|
|
@@ -78,7 +77,6 @@ module Elastic
|
|
|
78
77
|
def build_client(options = {})
|
|
79
78
|
client_options = options[:transport_options] || {}
|
|
80
79
|
client_options[:ssl] = options[:ssl] || {}
|
|
81
|
-
|
|
82
80
|
@manticore = ::Manticore::Client.new(client_options)
|
|
83
81
|
end
|
|
84
82
|
|
|
@@ -120,7 +118,6 @@ module Elastic
|
|
|
120
118
|
#
|
|
121
119
|
def __build_connections
|
|
122
120
|
apply_headers(options)
|
|
123
|
-
|
|
124
121
|
Connections::Collection.new(
|
|
125
122
|
connections: hosts.map do |host|
|
|
126
123
|
host[:protocol] = host[:scheme] || DEFAULT_PROTOCOL
|
|
@@ -169,7 +166,12 @@ module Elastic
|
|
|
169
166
|
|
|
170
167
|
def apply_headers(options)
|
|
171
168
|
headers = options[:headers].clone || options.dig(:transport_options, :headers).clone || {}
|
|
172
|
-
|
|
169
|
+
if (value = find_value(headers, CONTENT_TYPE_REGEX))
|
|
170
|
+
@request_options[:headers].reject! { |k, _| k.match? CONTENT_TYPE_REGEX }
|
|
171
|
+
headers[CONTENT_TYPE_STR] = value
|
|
172
|
+
else
|
|
173
|
+
headers[CONTENT_TYPE_STR] = DEFAULT_CONTENT_TYPE
|
|
174
|
+
end
|
|
173
175
|
headers[USER_AGENT_STR] = find_value(headers, USER_AGENT_REGEX) || find_value(@request_options[:headers], USER_AGENT_REGEX) || user_agent_header
|
|
174
176
|
headers[ACCEPT_ENCODING] = GZIP if use_compression?
|
|
175
177
|
@request_options[:headers].merge!(headers)
|
|
@@ -37,13 +37,27 @@ module Elastic
|
|
|
37
37
|
# De-serialize a Hash from JSON string
|
|
38
38
|
#
|
|
39
39
|
def load(string, options = {})
|
|
40
|
-
|
|
40
|
+
if deprecated_gem_version_loaded?
|
|
41
|
+
::MultiJson.load(string, options)
|
|
42
|
+
else
|
|
43
|
+
::MultiJSON.parse(string, options)
|
|
44
|
+
end
|
|
41
45
|
end
|
|
42
46
|
|
|
43
47
|
# Serialize a Hash to JSON string
|
|
44
48
|
#
|
|
45
49
|
def dump(object, options = {})
|
|
46
|
-
|
|
50
|
+
if deprecated_gem_version_loaded?
|
|
51
|
+
::MultiJson.dump(object, options)
|
|
52
|
+
else
|
|
53
|
+
::MultiJSON.generate(object, options)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
private
|
|
58
|
+
|
|
59
|
+
def deprecated_gem_version_loaded?
|
|
60
|
+
Gem.loaded_specs['multi_json'].version < Gem::Version.create('1.21.0')
|
|
47
61
|
end
|
|
48
62
|
end
|
|
49
63
|
end
|
data/lib/elastic/transport.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: elastic-transport
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.3.
|
|
4
|
+
version: 8.3.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Elastic Client Library Maintainers
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: faraday
|
|
@@ -38,20 +37,6 @@ dependencies:
|
|
|
38
37
|
- - ">="
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
39
|
version: '0'
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: curb
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - ">="
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '0'
|
|
48
|
-
type: :development
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - ">="
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '0'
|
|
55
40
|
- !ruby/object:Gem::Dependency
|
|
56
41
|
name: bundler
|
|
57
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -238,16 +223,16 @@ dependencies:
|
|
|
238
223
|
name: yard
|
|
239
224
|
requirement: !ruby/object:Gem::Requirement
|
|
240
225
|
requirements:
|
|
241
|
-
- - "
|
|
226
|
+
- - ">"
|
|
242
227
|
- !ruby/object:Gem::Version
|
|
243
|
-
version:
|
|
228
|
+
version: 0.9.42
|
|
244
229
|
type: :development
|
|
245
230
|
prerelease: false
|
|
246
231
|
version_requirements: !ruby/object:Gem::Requirement
|
|
247
232
|
requirements:
|
|
248
|
-
- - "
|
|
233
|
+
- - ">"
|
|
249
234
|
- !ruby/object:Gem::Version
|
|
250
|
-
version:
|
|
235
|
+
version: 0.9.42
|
|
251
236
|
description: 'Low level Ruby client for Elastic. See the `elasticsearch` or `elastic-enterprise-search`
|
|
252
237
|
gems for full integration.
|
|
253
238
|
|
|
@@ -257,23 +242,13 @@ email:
|
|
|
257
242
|
executables: []
|
|
258
243
|
extensions: []
|
|
259
244
|
extra_rdoc_files:
|
|
260
|
-
- README.md
|
|
261
245
|
- LICENSE
|
|
246
|
+
- README.md
|
|
262
247
|
files:
|
|
263
|
-
- ".github/check_license_headers.rb"
|
|
264
|
-
- ".github/license-header.txt"
|
|
265
|
-
- ".github/workflows/license.yml"
|
|
266
|
-
- ".github/workflows/otel.yml"
|
|
267
|
-
- ".github/workflows/tests.yml"
|
|
268
|
-
- ".gitignore"
|
|
269
248
|
- CHANGELOG.md
|
|
270
249
|
- CONTRIBUTING.md
|
|
271
|
-
- Gemfile
|
|
272
|
-
- Gemfile-faraday1.gemfile
|
|
273
250
|
- LICENSE
|
|
274
251
|
- README.md
|
|
275
|
-
- Rakefile
|
|
276
|
-
- elastic-transport.gemspec
|
|
277
252
|
- lib/elastic-transport.rb
|
|
278
253
|
- lib/elastic/transport.rb
|
|
279
254
|
- lib/elastic/transport/client.rb
|
|
@@ -293,29 +268,6 @@ files:
|
|
|
293
268
|
- lib/elastic/transport/transport/serializer/multi_json.rb
|
|
294
269
|
- lib/elastic/transport/transport/sniffer.rb
|
|
295
270
|
- lib/elastic/transport/version.rb
|
|
296
|
-
- spec/elastic/connections/collection_spec.rb
|
|
297
|
-
- spec/elastic/connections/selector_spec.rb
|
|
298
|
-
- spec/elastic/transport/base_spec.rb
|
|
299
|
-
- spec/elastic/transport/client_spec.rb
|
|
300
|
-
- spec/elastic/transport/http/curb_spec.rb
|
|
301
|
-
- spec/elastic/transport/http/faraday_spec.rb
|
|
302
|
-
- spec/elastic/transport/http/manticore_spec.rb
|
|
303
|
-
- spec/elastic/transport/meta_header_spec.rb
|
|
304
|
-
- spec/elastic/transport/opentelemetry_spec.rb
|
|
305
|
-
- spec/elastic/transport/sniffer_spec.rb
|
|
306
|
-
- spec/spec_helper.rb
|
|
307
|
-
- test/integration/jruby_test.rb
|
|
308
|
-
- test/integration/transport_test.rb
|
|
309
|
-
- test/profile/client_benchmark_test.rb
|
|
310
|
-
- test/test_helper.rb
|
|
311
|
-
- test/unit/adapters_test.rb
|
|
312
|
-
- test/unit/connection_test.rb
|
|
313
|
-
- test/unit/response_test.rb
|
|
314
|
-
- test/unit/serializer_test.rb
|
|
315
|
-
- test/unit/transport_base_test.rb
|
|
316
|
-
- test/unit/transport_curb_test.rb
|
|
317
|
-
- test/unit/transport_faraday_test.rb
|
|
318
|
-
- test/unit/transport_manticore_test.rb
|
|
319
271
|
homepage: https://github.com/elastic/elastic-transport-ruby
|
|
320
272
|
licenses:
|
|
321
273
|
- Apache-2.0
|
|
@@ -324,7 +276,6 @@ metadata:
|
|
|
324
276
|
changelog_uri: https://github.com/elastic/elastic-transport-ruby/blob/master/CHANGELOG.md
|
|
325
277
|
source_code_uri: https://github.com/elastic/elastic-transport-ruby
|
|
326
278
|
bug_tracker_uri: https://github.com/elastic/elastic-transport-ruby/issues
|
|
327
|
-
post_install_message:
|
|
328
279
|
rdoc_options:
|
|
329
280
|
- "--charset=UTF-8"
|
|
330
281
|
require_paths:
|
|
@@ -340,31 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
340
291
|
- !ruby/object:Gem::Version
|
|
341
292
|
version: '0'
|
|
342
293
|
requirements: []
|
|
343
|
-
rubygems_version:
|
|
344
|
-
signing_key:
|
|
294
|
+
rubygems_version: 4.0.12
|
|
345
295
|
specification_version: 4
|
|
346
296
|
summary: Low level Ruby client for Elastic services.
|
|
347
|
-
test_files:
|
|
348
|
-
- spec/elastic/connections/collection_spec.rb
|
|
349
|
-
- spec/elastic/connections/selector_spec.rb
|
|
350
|
-
- spec/elastic/transport/base_spec.rb
|
|
351
|
-
- spec/elastic/transport/client_spec.rb
|
|
352
|
-
- spec/elastic/transport/http/curb_spec.rb
|
|
353
|
-
- spec/elastic/transport/http/faraday_spec.rb
|
|
354
|
-
- spec/elastic/transport/http/manticore_spec.rb
|
|
355
|
-
- spec/elastic/transport/meta_header_spec.rb
|
|
356
|
-
- spec/elastic/transport/opentelemetry_spec.rb
|
|
357
|
-
- spec/elastic/transport/sniffer_spec.rb
|
|
358
|
-
- spec/spec_helper.rb
|
|
359
|
-
- test/integration/jruby_test.rb
|
|
360
|
-
- test/integration/transport_test.rb
|
|
361
|
-
- test/profile/client_benchmark_test.rb
|
|
362
|
-
- test/test_helper.rb
|
|
363
|
-
- test/unit/adapters_test.rb
|
|
364
|
-
- test/unit/connection_test.rb
|
|
365
|
-
- test/unit/response_test.rb
|
|
366
|
-
- test/unit/serializer_test.rb
|
|
367
|
-
- test/unit/transport_base_test.rb
|
|
368
|
-
- test/unit/transport_curb_test.rb
|
|
369
|
-
- test/unit/transport_faraday_test.rb
|
|
370
|
-
- test/unit/transport_manticore_test.rb
|
|
297
|
+
test_files: []
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# Licensed to Elasticsearch B.V. under one or more contributor
|
|
2
|
-
# license agreements. See the NOTICE file distributed with
|
|
3
|
-
# this work for additional information regarding copyright
|
|
4
|
-
# ownership. Elasticsearch B.V. licenses this file to you under
|
|
5
|
-
# the Apache License, Version 2.0 (the "License"); you may
|
|
6
|
-
# not use this file except in compliance with the License.
|
|
7
|
-
# You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing,
|
|
12
|
-
# software distributed under the License is distributed on an
|
|
13
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
# KIND, either express or implied. See the License for the
|
|
15
|
-
# specific language governing permissions and limitations
|
|
16
|
-
# under the License.
|
|
17
|
-
|
|
18
|
-
LICENSE = File.read('./.github/license-header.txt')
|
|
19
|
-
files = `git ls-files | grep -E '\.rb|Rakefile|\.rake|\.erb|Gemfile|gemspec'`.split("\n")
|
|
20
|
-
errors = []
|
|
21
|
-
|
|
22
|
-
files.each do |file|
|
|
23
|
-
unless File.read(file).include?(LICENSE)
|
|
24
|
-
errors << file
|
|
25
|
-
puts "#{file} doesn't contain the correct license header"
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
if errors.empty?
|
|
30
|
-
puts 'All checked files have the correct license header'
|
|
31
|
-
else
|
|
32
|
-
exit 1
|
|
33
|
-
end
|
data/.github/license-header.txt
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# Licensed to Elasticsearch B.V. under one or more contributor
|
|
2
|
-
# license agreements. See the NOTICE file distributed with
|
|
3
|
-
# this work for additional information regarding copyright
|
|
4
|
-
# ownership. Elasticsearch B.V. licenses this file to you under
|
|
5
|
-
# the Apache License, Version 2.0 (the "License"); you may
|
|
6
|
-
# not use this file except in compliance with the License.
|
|
7
|
-
# You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing,
|
|
12
|
-
# software distributed under the License is distributed on an
|
|
13
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
# KIND, either express or implied. See the License for the
|
|
15
|
-
# specific language governing permissions and limitations
|
|
16
|
-
# under the License.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
name: License headers
|
|
2
|
-
on: [pull_request]
|
|
3
|
-
jobs:
|
|
4
|
-
build:
|
|
5
|
-
runs-on: ubuntu-latest
|
|
6
|
-
steps:
|
|
7
|
-
- uses: actions/checkout@v4
|
|
8
|
-
- uses: ruby/setup-ruby@v1
|
|
9
|
-
with:
|
|
10
|
-
ruby-version: 3
|
|
11
|
-
- name: Check license headers
|
|
12
|
-
run: |
|
|
13
|
-
ruby ./.github/check_license_headers.rb
|
data/.github/workflows/otel.yml
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
name: opentelemetry
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches:
|
|
5
|
-
- main
|
|
6
|
-
pull_request:
|
|
7
|
-
branches:
|
|
8
|
-
- main
|
|
9
|
-
jobs:
|
|
10
|
-
test-otel:
|
|
11
|
-
name: 'Test Open Telemetry'
|
|
12
|
-
env:
|
|
13
|
-
TEST_ES_SERVER: http://localhost:9250
|
|
14
|
-
PORT: 9250
|
|
15
|
-
TEST_WITH_OTEL: true
|
|
16
|
-
strategy:
|
|
17
|
-
fail-fast: false
|
|
18
|
-
matrix:
|
|
19
|
-
ruby: ['3.3', 'jruby-9.4']
|
|
20
|
-
es_version: ['8.15.0-SNAPSHOT']
|
|
21
|
-
runs-on: ubuntu-latest
|
|
22
|
-
steps:
|
|
23
|
-
- uses: actions/checkout@v4
|
|
24
|
-
- name: Increase system limits
|
|
25
|
-
run: |
|
|
26
|
-
sudo swapoff -a
|
|
27
|
-
sudo sysctl -w vm.swappiness=1
|
|
28
|
-
sudo sysctl -w fs.file-max=262144
|
|
29
|
-
sudo sysctl -w vm.max_map_count=262144
|
|
30
|
-
- uses: elastic/elastic-github-actions/elasticsearch@master
|
|
31
|
-
with:
|
|
32
|
-
stack-version: ${{ matrix.es_version }}
|
|
33
|
-
security-enabled: false
|
|
34
|
-
- uses: ruby/setup-ruby@v1
|
|
35
|
-
with:
|
|
36
|
-
ruby-version: ${{ matrix.ruby }}
|
|
37
|
-
- name: Build and test with Rake
|
|
38
|
-
run: |
|
|
39
|
-
sudo apt-get update
|
|
40
|
-
sudo apt-get install libcurl4-openssl-dev
|
|
41
|
-
ruby -v
|
|
42
|
-
bundle install
|
|
43
|
-
- name: unit tests
|
|
44
|
-
run: bundle exec rake test:unit
|
|
45
|
-
- name: specs
|
|
46
|
-
run: bundle exec rake test:spec
|
|
47
|
-
- name: integration tests
|
|
48
|
-
run: bundle exec rake test:integration
|
data/.github/workflows/tests.yml
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
name: main tests
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches:
|
|
5
|
-
- main
|
|
6
|
-
pull_request:
|
|
7
|
-
branches:
|
|
8
|
-
- main
|
|
9
|
-
jobs:
|
|
10
|
-
test:
|
|
11
|
-
name: 'Main tests'
|
|
12
|
-
env:
|
|
13
|
-
TEST_ES_SERVER: http://localhost:9250
|
|
14
|
-
PORT: 9250
|
|
15
|
-
strategy:
|
|
16
|
-
fail-fast: false
|
|
17
|
-
matrix:
|
|
18
|
-
ruby: ['3.0', '3.1', '3.2', '3.3', 'jruby-9.3', 'jruby-9.4']
|
|
19
|
-
es_version: ['8.14.2-SNAPSHOT', '8.15.0-SNAPSHOT', '8.16.0-SNAPSHOT']
|
|
20
|
-
runs-on: ubuntu-latest
|
|
21
|
-
steps:
|
|
22
|
-
- uses: actions/checkout@v4
|
|
23
|
-
- name: Increase system limits
|
|
24
|
-
run: |
|
|
25
|
-
sudo swapoff -a
|
|
26
|
-
sudo sysctl -w vm.swappiness=1
|
|
27
|
-
sudo sysctl -w fs.file-max=262144
|
|
28
|
-
sudo sysctl -w vm.max_map_count=262144
|
|
29
|
-
- uses: elastic/elastic-github-actions/elasticsearch@master
|
|
30
|
-
with:
|
|
31
|
-
stack-version: ${{ matrix.es_version }}
|
|
32
|
-
security-enabled: false
|
|
33
|
-
- uses: ruby/setup-ruby@v1
|
|
34
|
-
with:
|
|
35
|
-
ruby-version: ${{ matrix.ruby }}
|
|
36
|
-
- name: Build and test with Rake
|
|
37
|
-
run: |
|
|
38
|
-
sudo apt-get update
|
|
39
|
-
sudo apt-get install libcurl4-openssl-dev
|
|
40
|
-
ruby -v
|
|
41
|
-
bundle install
|
|
42
|
-
- name: unit tests
|
|
43
|
-
run: bundle exec rake test:unit
|
|
44
|
-
- name: specs
|
|
45
|
-
run: bundle exec rake test:spec
|
|
46
|
-
- name: integration tests
|
|
47
|
-
run: bundle exec rake test:integration
|
|
48
|
-
test-faraday1:
|
|
49
|
-
name: 'Test Faraday 1'
|
|
50
|
-
env:
|
|
51
|
-
TEST_ES_SERVER: http://localhost:9250
|
|
52
|
-
PORT: 9250
|
|
53
|
-
strategy:
|
|
54
|
-
fail-fast: false
|
|
55
|
-
matrix:
|
|
56
|
-
ruby: ['3.0', '3.1', '3.2', '3.3', 'jruby-9.3']
|
|
57
|
-
es_version: ['8.16.0-SNAPSHOT']
|
|
58
|
-
runs-on: ubuntu-latest
|
|
59
|
-
steps:
|
|
60
|
-
- uses: actions/checkout@v4
|
|
61
|
-
- name: Increase system limits
|
|
62
|
-
run: |
|
|
63
|
-
sudo swapoff -a
|
|
64
|
-
sudo sysctl -w vm.swappiness=1
|
|
65
|
-
sudo sysctl -w fs.file-max=262144
|
|
66
|
-
sudo sysctl -w vm.max_map_count=262144
|
|
67
|
-
- uses: elastic/elastic-github-actions/elasticsearch@master
|
|
68
|
-
with:
|
|
69
|
-
stack-version: ${{ matrix.es_version }}
|
|
70
|
-
security-enabled: false
|
|
71
|
-
- uses: ruby/setup-ruby@v1
|
|
72
|
-
with:
|
|
73
|
-
ruby-version: ${{ matrix.ruby }}
|
|
74
|
-
- name: Build and test with Rake
|
|
75
|
-
run: |
|
|
76
|
-
sudo apt-get update
|
|
77
|
-
sudo apt-get install libcurl4-openssl-dev
|
|
78
|
-
ruby -v
|
|
79
|
-
BUNDLE_GEMFILE=./Gemfile-faraday1.gemfile bundle install
|
|
80
|
-
- name: faraday1 unit tests
|
|
81
|
-
run: BUNDLE_GEMFILE=./Gemfile-faraday1.gemfile bundle exec rake test:faraday1:unit
|
|
82
|
-
- name: specs
|
|
83
|
-
run: BUNDLE_GEMFILE=./Gemfile-faraday1.gemfile bundle exec rake test:faraday1:spec
|
|
84
|
-
- name: integration tests
|
|
85
|
-
run: BUNDLE_GEMFILE=./Gemfile-faraday1.gemfile bundle exec rake test:faraday1:integration
|
data/.gitignore
DELETED
data/Gemfile
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Licensed to Elasticsearch B.V. under one or more contributor
|
|
2
|
-
# license agreements. See the NOTICE file distributed with
|
|
3
|
-
# this work for additional information regarding copyright
|
|
4
|
-
# ownership. Elasticsearch B.V. licenses this file to you under
|
|
5
|
-
# the Apache License, Version 2.0 (the "License"); you may
|
|
6
|
-
# not use this file except in compliance with the License.
|
|
7
|
-
# You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing,
|
|
12
|
-
# software distributed under the License is distributed on an
|
|
13
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
# KIND, either express or implied. See the License for the
|
|
15
|
-
# specific language governing permissions and limitations
|
|
16
|
-
# under the License.
|
|
17
|
-
|
|
18
|
-
source 'https://rubygems.org'
|
|
19
|
-
|
|
20
|
-
# Specify your gem's dependencies in elasticsearch-transport.gemspec
|
|
21
|
-
gemspec
|
|
22
|
-
|
|
23
|
-
group :development, :test do
|
|
24
|
-
gem 'faraday-httpclient'
|
|
25
|
-
gem 'faraday-net_http_persistent'
|
|
26
|
-
gem 'faraday-typhoeus'
|
|
27
|
-
gem 'opentelemetry-sdk', require: false if RUBY_VERSION >= '3.0'
|
|
28
|
-
if defined?(JRUBY_VERSION)
|
|
29
|
-
gem 'pry-nav'
|
|
30
|
-
else
|
|
31
|
-
gem 'faraday-patron'
|
|
32
|
-
gem 'oj'
|
|
33
|
-
gem 'pry-byebug'
|
|
34
|
-
end
|
|
35
|
-
gem 'rspec'
|
|
36
|
-
end
|
data/Gemfile-faraday1.gemfile
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# Licensed to Elasticsearch B.V. under one or more contributor
|
|
2
|
-
# license agreements. See the NOTICE file distributed with
|
|
3
|
-
# this work for additional information regarding copyright
|
|
4
|
-
# ownership. Elasticsearch B.V. licenses this file to you under
|
|
5
|
-
# the Apache License, Version 2.0 (the "License"); you may
|
|
6
|
-
# not use this file except in compliance with the License.
|
|
7
|
-
# You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing,
|
|
12
|
-
# software distributed under the License is distributed on an
|
|
13
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
# KIND, either express or implied. See the License for the
|
|
15
|
-
# specific language governing permissions and limitations
|
|
16
|
-
# under the License.
|
|
17
|
-
|
|
18
|
-
source 'https://rubygems.org'
|
|
19
|
-
|
|
20
|
-
# Usage:
|
|
21
|
-
#
|
|
22
|
-
# $ BUNDLE_GEMFILE=./Gemfile-faraday1.gemfile bundle install
|
|
23
|
-
# $ BUNDLE_GEMFILE=./Gemfile-faraday1.gemfile bundle exec rake test:faraday1:unit
|
|
24
|
-
|
|
25
|
-
gem 'faraday', '~> 1'
|
|
26
|
-
gemspec
|
|
27
|
-
|
|
28
|
-
group :development, :test do
|
|
29
|
-
gem 'httpclient'
|
|
30
|
-
gem 'net-http-persistent'
|
|
31
|
-
gem 'rspec'
|
|
32
|
-
gem 'typhoeus'
|
|
33
|
-
if defined?(JRUBY_VERSION)
|
|
34
|
-
gem 'pry-nav'
|
|
35
|
-
else
|
|
36
|
-
gem 'pry-byebug'
|
|
37
|
-
gem 'oj'
|
|
38
|
-
gem 'patron'
|
|
39
|
-
end
|
|
40
|
-
end
|