From e4132134b76fa4ea3d88dfd5794487822ba04b8c Mon Sep 17 00:00:00 2001 From: Alexander Sviridov Date: Tue, 27 Aug 2024 15:09:57 +0300 Subject: [PATCH] Bump version, update docs --- CHANGELOG.md | 12 ++++++++++++ README.md | 34 +++++++++++++++++++++++++++++++++- lib/chewy/version.rb | 2 +- 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25291ca2..0c27c85f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,18 @@ ### Bugs Fixed +## 8.0.0-beta (2024-08-27) + +### New Features + +* [#962](https://github.com/toptal/chewy/pull/962): ElasticSearch v.8 support added + +* `delete_all_enabled` setting introduced to align Chewy.massacre with wildcard indices deletion disabled in ES 8 by default + +### Changes + +### Bugs Fixed + ## 7.6.0 (2024-05-03) ### Changes diff --git a/README.md b/README.md index 23c13993..da00cef6 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ Chewy is compatible with MRI 3.0-3.2ยน. | Chewy version | Elasticsearch version | | ------------- | ---------------------------------- | +| 8.0.0 | 8.x | | 7.2.x | 7.x | | 7.1.x | 7.x | | 7.0.x | 6.8, 7.x | @@ -97,7 +98,36 @@ development: Make sure you have Elasticsearch up and running. You can [install](https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html) it locally, but the easiest way is to use [Docker](https://www.docker.com/get-started): ```shell -$ docker run --rm --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:7.11.1 +$ docker run --rm --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e "xpack.security.enabled=false" elasticsearch:8.15.0 +``` + +### Security + +Please note that starting from version 8 ElasticSearch has security features enabled by default. +Docker command above has it disabled for local testing convenience. If you want to enable it, omit +`"xpack.security.enabled=false"` part from Docker command, and run these command after starting container (container name `es8` assumed): + +Reset password for `elastic` user: +``` +docker container exec es8 '/usr/share/elasticsearch/bin/elasticsearch-reset-password' -u elastic +``` + +Extract CA certificate generated by ElasticSearch on first run: +``` +docker container cp es8:/usr/share/elasticsearch/config/certs/http_ca.crt tmp/ +``` + +And then add them to settings: + +```yaml +# config/chewy.yml +development: + host: 'localhost:9200' + user: 'elastic' + password: 'SomeLongPassword' + transport_options: + ssl: + ca_file: './tmp/http_ca.crt' ``` ### Index @@ -941,6 +971,8 @@ Controller actions are wrapped with the configurable value of `Chewy.request_str It is also a good idea to set up the `:bypass` strategy inside your test suite and import objects manually only when needed, and use `Chewy.massacre` when needed to flush test ES indices before every example. This will allow you to minimize unnecessary ES requests and reduce overhead. +Deprecation note: since version 8 wildcard removing of indices is disabled by default. You can enable it for a cluster with setting `action.destructive_requires_name` to false. + ```ruby RSpec.configure do |config| config.before(:suite) do diff --git a/lib/chewy/version.rb b/lib/chewy/version.rb index a0c87a40..bafa371a 100644 --- a/lib/chewy/version.rb +++ b/lib/chewy/version.rb @@ -1,3 +1,3 @@ module Chewy - VERSION = '7.6.0'.freeze + VERSION = '8.0.0'.freeze end