Skip to content

Commit

Permalink
Bump client version to 2.0 and add OpenSearch 2.0 (#69)
Browse files Browse the repository at this point in the history
Signed-off-by: Vacha Shah <[email protected]>
  • Loading branch information
VachaShah authored May 26, 2022
1 parent f03d6d4 commit 0becd4d
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
cluster-version: [ "1.0.0", "1.0.1", "1.1.0", "1.2.0", "1.2.1", "1.2.2", "1.2.3", "1.2.4", "1.3.0", "1.3.1" ]
cluster-version: [ "1.0.0", "1.0.1", "1.1.0", "1.2.0", "1.2.1", "1.2.2", "1.2.3", "1.2.4", "1.3.0", "1.3.1", "2.0.0" ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
strategy:
fail-fast: false
matrix:
cluster-version: [ "1.0.0", "1.0.1", "1.1.0", "1.2.0", "1.2.1", "1.2.2", "1.2.3", "1.2.4", "1.3.0", "1.3.1" ]
cluster-version: [ "1.0.0", "1.0.1", "1.1.0", "1.2.0", "1.2.1", "1.2.2", "1.2.3", "1.2.4", "1.3.0", "1.3.1", "2.0.0" ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions COMPATIBILITY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
- [Compatibility with OpenSearch](#compatibility-with-opensearch)
- [Upgrading](#upgrading)

## Compatibility with OpenSearch

Expand Down
2 changes: 1 addition & 1 deletion opensearch-api/lib/opensearch/api/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@

module OpenSearch
module API
VERSION = '1.0.0'.freeze
VERSION = '2.0.0'.freeze
end
end
2 changes: 1 addition & 1 deletion opensearch-dsl/lib/opensearch/dsl/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@

module OpenSearch
module DSL
VERSION = "0.1.0"
VERSION = "0.2.0"
end
end
2 changes: 1 addition & 1 deletion opensearch-transport/lib/opensearch/transport/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@

module OpenSearch
module Transport
VERSION = '1.0.0'.freeze
VERSION = '2.0.0'.freeze
end
end
2 changes: 1 addition & 1 deletion opensearch/lib/opensearch/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
# under the License.

module OpenSearch
VERSION = '1.0.0'.freeze
VERSION = '2.0.0'.freeze
end
4 changes: 2 additions & 2 deletions opensearch/opensearch.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ Gem::Specification.new do |s|

s.required_ruby_version = '>= 2.4'

s.add_dependency 'opensearch-transport', '1.0.0'
s.add_dependency 'opensearch-api', '1.0.0'
s.add_dependency 'opensearch-transport', '2.0.0'
s.add_dependency 'opensearch-api', '2.0.0'

s.add_development_dependency 'bundler'
s.add_development_dependency 'byebug' unless defined?(JRUBY_VERSION) || defined?(Rubinius)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
require 'logger'

describe 'OpenSearch validation integration' do
it 'Validates for OpenSearch 1.0.0-SNAPSHOT' do
it 'Validates for OpenSearch' do
client = OpenSearch::Client.new(
host: OPENSEARCH_URL,
logger: Logger.new($stderr)
Expand Down
10 changes: 5 additions & 5 deletions opensearch/spec/unit/opensearch_product_validation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def valid_requests_and_expectations
end
end

context 'When Elasticsearch replies with status 403' do
context 'When OpenSearch replies with status 403' do
let(:status) { 403 }
let(:body) { {}.to_json }

Expand All @@ -105,9 +105,9 @@ def valid_requests_and_expectations
end
end

context 'When the OpenSearch version is 1.0.0-SNAPSHOT' do
context 'When the OpenSearch version is 2.0.0' do
context 'With a valid OpenSearch response' do
let(:body) { { 'version' => { 'number' => '1.0.0-SNAPSHOT', 'distribution' => 'opensearch' } }.to_json }
let(:body) { { 'version' => { 'number' => '2.0.0', 'distribution' => 'opensearch' } }.to_json }
let(:headers) do
{
'content-type' => 'json'
Expand All @@ -123,7 +123,7 @@ def valid_requests_and_expectations
end

context 'When the distribution is not present' do
let(:body) { { 'version' => { 'number' => '1.0.0-SNAPSHOT' } }.to_json }
let(:body) { { 'version' => { 'number' => '2.0.0' } }.to_json }
it 'Fails validation' do
verify_request_stub

Expand Down Expand Up @@ -187,7 +187,7 @@ def valid_requests_and_expectations
end

let(:headers) { { 'content-type' => 'application/yaml'} }
let(:body) { "---\nversion:\n number: \"1.0.0-SNAPSHOT\"\n distribution: \"opensearch\"\n" }
let(:body) { "---\nversion:\n number: \"2.0.0\"\n distribution: \"opensearch\"\n" }

it 'validates' do
verify_request_stub
Expand Down

0 comments on commit 0becd4d

Please sign in to comment.