elastic-transport 8.2.0 → 8.2.1

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: aca3fc15486eeb7455f903dbaa5b6a594d4fd410f895cff6b3bf832c0dcad8b4
4
- data.tar.gz: 4fd798b71008e3bba436434a5c98321fcd2b15934a6244908966c8b9cdd5c3e0
3
+ metadata.gz: 97ae80fff7c8f2354bcb14259c86df214ffe8e95cd3027c7716a3e04b51e0e84
4
+ data.tar.gz: c8f303cbe8d6f12136ff6f19ac5975cc0ea9bbe9dc18c3602f72121b8b0bb99f
5
5
  SHA512:
6
- metadata.gz: a33a557b17fc75fbc2cd9b8fb713603b67c35097fce929ccdee0b81b76c58c05885286aeb1aeed8c72068d6c12a83b51e6dc1f9f07678d6e17f51ce962cb0af8
7
- data.tar.gz: 5105d1a01106314206e250a105329abfb9553f6c12170bafaf8b7eb4741f5d7b9b414027919aac9df9867ee0859fbfce6b492fbc64a8335f17eebcc7fd109cf4
6
+ metadata.gz: 62af9d690c084cd40dae188cb5f959a7acd0d67fbf62a7b27abe0e57d3cb0b78644ea36dc04c5f2597f980de113850a0757860d81519759f2a8b965894c0e90c
7
+ data.tar.gz: 59c4cafc61dfb858639934876eb004037c2e31e86a61d3863ed65083fa1d5f0bc2bb15833123c2a5d7d6c7434e9ca74b8fd6721800822141d7ec3af98169a7c6
data/CHANGELOG.md CHANGED
@@ -1,8 +1,14 @@
1
+ ## 8.2.1
2
+
3
+ Tested versions of Ruby: (MRI) 2.7, 3.0, 3.1, 3.2, JRuby 9.3 and JRuby 9.4. Ruby 2.7's end of life is coming in a few days, so this'll probably be the last release to test for Ruby 2.7.
4
+
5
+ - Fixes parsing ipv4 addresses like `inet[/127.0.0.1:9200]` in sniffer, [issue #48](https://github.com/elastic/elastic-transport-ruby/issues/48). [Pull Request](https://github.com/elastic/elastic-transport-ruby/pull/49) by [@robbat2](https://github.com/robbat2), thank you!
6
+
1
7
  ## 8.2.0
2
8
 
3
9
  Tested versions of Ruby: (MRI) 2.7, 3.0, 3.1, 3.2, JRuby 9.3 and JRuby 9.4.
4
10
 
5
- - Fixes [issue #44](https://github.com/elastic/elastic-transport-ruby/issues/44), raising `Elasticsearch::Transport::Transport::Error` instead of `Faraday::ConnectionFailed` (or any other Faraday error class) when a host is unreachable.
11
+ - Fixes [issue #44](https://github.com/elastic/elastic-transport-ruby/issues/44), raising `Elastic::Transport::Transport::Error` instead of `Faraday::ConnectionFailed` (or any other Faraday error class) when a host is unreachable.
6
12
  - Removes development dependency on `ansi`, it hasn't been updated for years.
7
13
  - Adds `rake console` task to run IRB with the Elastic transport client libraries loaded.
8
14
  - General refactors, cleanup and updates in code for `base.rb` (The base class used by HTTP implementations Faraday, Manticore, Curb), `errors.rb`, `faraday.rb`, and more.
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,58 @@
1
+ # Contributing to Elasticsearch Transport Ruby
2
+
3
+
4
+ This guide assumes Ruby is already installed. We follow Ruby’s own maintenance policy and officially support all currently maintained versions per [Ruby Maintenance Branches](https://www.ruby-lang.org/en/downloads/branches/). So we can't guarantee the code works for versions of Ruby that have reached their end of life.
5
+
6
+ To work on the code, clone the project first:
7
+
8
+ ```
9
+ $ git clone git@github.com:elastic/elastic-transport-ruby.git
10
+ ```
11
+
12
+ And run `bundle install` to install dependencies.
13
+
14
+ # Tests
15
+
16
+ There are several test tasks in the Rakefile, you can check them with `rake -T` from the project's root directory.
17
+
18
+ ```bash
19
+ rake test:unit
20
+ rake test:spec
21
+ rake test:integration
22
+ ```
23
+
24
+ Use `COVERAGE=true` before running a test task to check coverage with Simplecov.
25
+
26
+ Github's pull requests and issues are used to communicate, send bug reports and code contributions. Bug fixes and features must be covered by unit tests.
27
+
28
+ You need an Elasticsearch cluster running for integration tests. The tests will use the default host `localhost:9200`, but you can change this value by setting the environment variables `TEST_ES_SERVER` or `ELASTICSEARCH_HOSTS`:
29
+
30
+ ```
31
+ $ TEST_ES_SERVER=host:port rake test:integration
32
+ ```
33
+
34
+ A rake task is included to launch an Elasticsearch cluster with Docker. You need to install docker on your system and then run:
35
+ ```bash
36
+ $ rake docker:start[VERSION]
37
+ ```
38
+
39
+ E.g.:
40
+ ```bash
41
+ $ rake docker:start[8.0.0-alpha1]
42
+ ```
43
+
44
+ You can find the available version in [Docker @ Elastic](https://www.docker.elastic.co/r/elasticsearch).
45
+
46
+ # Contributing
47
+
48
+ The process for contributing is:
49
+
50
+ 1. It is best to do your work in a separate Git branch. This makes it easier to synchronise your changes with [`rebase`](http://mislav.uniqpath.com/2013/02/merge-vs-rebase/).
51
+
52
+ 2. Make sure your changes don't break any existing tests, and that you add tests for both bugfixes and new functionality.
53
+
54
+ 3. **Sign the contributor license agreement.**
55
+ Please make sure you have signed the [Contributor License Agreement](https://www.elastic.co/contributor-agreement/). We are not asking you to assign copyright to us, but to give us the right to distribute your code without restriction. We ask this of all contributors in order to assure our users of the origin and continuing existence of the code. You only need to sign the CLA once.
56
+
57
+ 4. Submit a pull request.
58
+ Push your local changes to your forked copy of the repository and submit a pull request. In the pull request, describe what your changes do and mention the number of the issue where discussion has taken place, eg “Closes #123″.
data/README.md CHANGED
@@ -23,32 +23,7 @@ This gem is compatible with maintained Ruby versions. See [Ruby Maintenance Bran
23
23
 
24
24
  ## Development and Community
25
25
 
26
- For local development, clone the repository and run `bundle install`. See `rake -T` for a list of available Rake tasks for running tests, generating documentation, starting a testing cluster, etc.
27
-
28
- Bug fixes and features must be covered by unit tests.
29
-
30
- A rake task is included to launch an Elasticsearch cluster with Docker. You need to install docker on your system and then run:
31
- ```bash
32
- $ rake docker:start[VERSION]
33
- ```
34
-
35
- E.g.:
36
- ```bash
37
- $ rake docker:start[8.0.0-alpha1]
38
- ```
39
-
40
- You can find the available version in [Docker @ Elastic](https://www.docker.elastic.co/r/elasticsearch).
41
-
42
- To run tests, launch a testing cluster and use the Rake tasks:
43
-
44
- ```bash
45
- time rake test:unit
46
- time rake test:integration
47
- ```
48
-
49
- Use `COVERAGE=true` before running a test task to check coverage with Simplecov.
50
-
51
- Github's pull requests and issues are used to communicate, send bug reports and code contributions.
26
+ See [CONTRIBUTING](./CONTRIBUTING.md).
52
27
 
53
28
  ## License
54
29
 
@@ -76,7 +76,9 @@ module Elastic
76
76
  end
77
77
 
78
78
  def parse_publish_address(publish_address)
79
- # publish_address is in the format hostname/ip:port
79
+ # When publish_address is in the format 'inet[hostname/ip:port]'
80
+ return parse_address_port(publish_address[6..-2]) if publish_address =~ /^inet\[.*\]$/
81
+
80
82
  if publish_address =~ /\//
81
83
  parts = publish_address.partition('/')
82
84
  [ parts[0], parse_address_port(parts[2])[1] ]
@@ -17,6 +17,6 @@
17
17
 
18
18
  module Elastic
19
19
  module Transport
20
- VERSION = '8.2.0'.freeze
20
+ VERSION = '8.2.1'.freeze
21
21
  end
22
22
  end
@@ -257,6 +257,24 @@ describe Elastic::Transport::Transport::Sniffer do
257
257
  end
258
258
  end
259
259
 
260
+ context 'when the address is IPv4' do
261
+ let(:publish_address) do
262
+ 'inet[/127.0.0.1:9200]'
263
+ end
264
+
265
+ it 'parses the response' do
266
+ expect(hosts.size).to eq(1)
267
+ end
268
+
269
+ it 'correctly parses the host' do
270
+ expect(hosts[0][:host]).to eq('127.0.0.1')
271
+ end
272
+
273
+ it 'correctly parses the port' do
274
+ expect(hosts[0][:port]).to eq('9200')
275
+ end
276
+ end
277
+
260
278
  context 'when the transport has :randomize_hosts option' do
261
279
  let(:raw_response) do
262
280
  { 'nodes' => { 'n1' => { 'http' => { 'publish_address' => '127.0.0.1:9250' } },
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic-transport
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.2.0
4
+ version: 8.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karel Minarik
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-01-30 00:00:00.000000000 Z
13
+ date: 2023-03-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
@@ -268,6 +268,7 @@ files:
268
268
  - ".github/workflows/tests.yml"
269
269
  - ".gitignore"
270
270
  - CHANGELOG.md
271
+ - CONTRIBUTING.md
271
272
  - Gemfile
272
273
  - Gemfile-faraday1.gemfile
273
274
  - LICENSE
@@ -338,7 +339,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
338
339
  - !ruby/object:Gem::Version
339
340
  version: '0'
340
341
  requirements: []
341
- rubygems_version: 3.3.7
342
+ rubygems_version: 3.4.8
342
343
  signing_key:
343
344
  specification_version: 4
344
345
  summary: Low level Ruby client for Elastic services.