chewy 7.0.0 → 7.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +94 -0
- data/CHANGELOG.md +7 -0
- data/lib/chewy/search/request.rb +1 -1
- data/lib/chewy/version.rb +1 -1
- data/migration_guide.md +25 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1dd4e22b7f5c013837c2799973a115efec21cac6555a8ec9f30c85b63525f155
|
4
|
+
data.tar.gz: d938f5225426da6b649179bcacced5f24974a80995cf4dd62ac77f8e9484df8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f54a6ae762f36af260a07f7da838d802e5152431b14b8120c1be2fa083510ecaf1ae650e115294a2bac3ad4ae17bac399b0873d4259e63f4ad9a655c05bfa224
|
7
|
+
data.tar.gz: d2c4cf7030995844d04841ad0739497dacffd3fb57d52ca6d7aed871d30e112fe6eb88f084a678c7090d359f91f944b21fc4f45b65f1f9fffa6da2775f9845b0
|
@@ -0,0 +1,94 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
tests:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
strategy:
|
9
|
+
fail-fast: false
|
10
|
+
matrix:
|
11
|
+
ruby: [2.6, 2.7]
|
12
|
+
gemfile: [rails.5.2.activerecord, rails.6.0.activerecord, rails.6.1.activerecord]
|
13
|
+
name: ${{ matrix.ruby }}-${{ matrix.gemfile }}
|
14
|
+
|
15
|
+
env:
|
16
|
+
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
|
17
|
+
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v2
|
20
|
+
- uses: ruby/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
ruby-version: ${{ matrix.ruby }}
|
23
|
+
bundler-cache: true
|
24
|
+
- name: Run Elasticsearch
|
25
|
+
uses: elastic/elastic-github-actions/elasticsearch@master
|
26
|
+
with:
|
27
|
+
stack-version: 7.10.1
|
28
|
+
port: 9250
|
29
|
+
- name: Tests
|
30
|
+
run: bundle exec rspec
|
31
|
+
|
32
|
+
ruby-3-0-activerecord-6-1:
|
33
|
+
runs-on: ubuntu-latest
|
34
|
+
env:
|
35
|
+
BUNDLE_GEMFILE: gemfiles/rails.6.1.activerecord.gemfile
|
36
|
+
steps:
|
37
|
+
- uses: actions/checkout@v2
|
38
|
+
- uses: ruby/setup-ruby@v1
|
39
|
+
with:
|
40
|
+
ruby-version: '3.0'
|
41
|
+
bundler-cache: true
|
42
|
+
- name: Run Elasticsearch
|
43
|
+
uses: elastic/elastic-github-actions/elasticsearch@master
|
44
|
+
with:
|
45
|
+
stack-version: 7.10.1
|
46
|
+
port: 9250
|
47
|
+
- name: Tests
|
48
|
+
run: bundle exec rspec
|
49
|
+
|
50
|
+
ruby-3-0-activerecord-6-1-es6:
|
51
|
+
runs-on: ubuntu-latest
|
52
|
+
env:
|
53
|
+
BUNDLE_GEMFILE: gemfiles/rails.6.1.activerecord.gemfile
|
54
|
+
steps:
|
55
|
+
- uses: actions/checkout@v2
|
56
|
+
- uses: ruby/setup-ruby@v1
|
57
|
+
with:
|
58
|
+
ruby-version: '3.0'
|
59
|
+
bundler-cache: true
|
60
|
+
- name: Run Elasticsearch
|
61
|
+
uses: elastic/elastic-github-actions/elasticsearch@master
|
62
|
+
with:
|
63
|
+
stack-version: 6.8.15
|
64
|
+
port: 9250
|
65
|
+
- name: Tests
|
66
|
+
run: bundle exec rspec
|
67
|
+
|
68
|
+
ruby-2-7-activerecord-6-1-es6:
|
69
|
+
runs-on: ubuntu-latest
|
70
|
+
env:
|
71
|
+
BUNDLE_GEMFILE: gemfiles/rails.6.1.activerecord.gemfile
|
72
|
+
steps:
|
73
|
+
- uses: actions/checkout@v2
|
74
|
+
- uses: ruby/setup-ruby@v1
|
75
|
+
with:
|
76
|
+
ruby-version: 2.7
|
77
|
+
bundler-cache: true
|
78
|
+
- name: Run Elasticsearch
|
79
|
+
uses: elastic/elastic-github-actions/elasticsearch@master
|
80
|
+
with:
|
81
|
+
stack-version: 6.8.15
|
82
|
+
port: 9250
|
83
|
+
- name: Tests
|
84
|
+
run: bundle exec rspec
|
85
|
+
|
86
|
+
rubocop:
|
87
|
+
runs-on: ubuntu-latest
|
88
|
+
steps:
|
89
|
+
- uses: actions/checkout@v2
|
90
|
+
- uses: ruby/setup-ruby@v1
|
91
|
+
with:
|
92
|
+
ruby-version: 2.7
|
93
|
+
bundler-cache: true
|
94
|
+
- run: bundle exec rubocop --format simple
|
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,13 @@
|
|
8
8
|
|
9
9
|
### Bugs Fixed
|
10
10
|
|
11
|
+
## 7.0.1 (2021-05-03)
|
12
|
+
|
13
|
+
### Changes
|
14
|
+
|
15
|
+
* [#792](https://github.com/toptal/chewy/pull/792): Skip ES version memoization for search requests ([@rabotyaga][])
|
16
|
+
* See the Migration Guide for details
|
17
|
+
|
11
18
|
## 7.0.0 (2021-02-22)
|
12
19
|
|
13
20
|
### New Features
|
data/lib/chewy/search/request.rb
CHANGED
@@ -990,7 +990,7 @@ module Chewy
|
|
990
990
|
|
991
991
|
def perform(additional = {})
|
992
992
|
request_body = render.merge(additional)
|
993
|
-
request_body[:rest_total_hits_as_int] = true if Runtime.version >= '7.0.0'
|
993
|
+
request_body[:rest_total_hits_as_int] = true if Chewy::Runtime::Version.new(Chewy.client.info['version']['number']) >= '7.0.0'
|
994
994
|
ActiveSupport::Notifications.instrument 'search_query.chewy',
|
995
995
|
notification_payload(request: request_body) do
|
996
996
|
begin
|
data/lib/chewy/version.rb
CHANGED
data/migration_guide.md
CHANGED
@@ -10,10 +10,32 @@ In order to upgrade Chewy 6/Elasticsearch 6 to Chewy 7/Elasticsearch 7 in the mo
|
|
10
10
|
|
11
11
|
* Upgrade to the latest 6.x stable releases, namely Chewy 6.0, Elasticsearch 6.8
|
12
12
|
* Study carefully [Breaking changes in 7.0](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.htmll), make sure your application conforms.
|
13
|
-
* Run your test suite on Chewy 7 / Elasticsearch 7
|
14
|
-
* Run manual tests on Chewy 7 / Elasticsearch 7
|
15
|
-
* Upgrade to Chewy 7
|
13
|
+
* Run your test suite on Chewy 7.0 / Elasticsearch 7
|
14
|
+
* Run manual tests on Chewy 7.0 / Elasticsearch 7
|
15
|
+
* Upgrade to Chewy 7.0
|
16
|
+
* The “total hits” counter is an integer for ES versions < 7 and an object (hash) for the versions starting from 7.0.0. Elasticsearch added a special option, `rest_total_hits_as_int`, to ease the upgrade, that could be appended to any request and results in the old “total hits” format. Unfortunately, this option is not recognized by ES versions prior to 7.0.0, which means that we have to check the version to decide if we need this option.
|
17
|
+
Normally Chewy does memoization of the current ES version, but this might be inappropriate for the upgrade, as the version changes live.
|
18
|
+
To handle that we have 2 versions of Chewy for this stage of the upgrade: 7.0.0 and 7.0.1. Version 7.0.0 does the memoization and version 7.0.1 requests the current version on every search request.
|
19
|
+
* You can use the 7.0.0 version if it's fine for you to have an application restart immediately after ES cluster upgrade.
|
20
|
+
* If you're using the 7.0.1 version you might be interested in keeping the timeframe between this step and the last one as small as possible, as version 7.0.1 skips ES version memoization for search requests to help dynamically detect ES version. This leads to an extra version request on each search request, i.e. could affect the overall performance/latency of the search and a load of ES cluster.
|
16
21
|
* Perform a [rolling upgrade](https://www.elastic.co/guide/en/elasticsearch/reference//rolling-upgrades.html) of Elasticsearch
|
22
|
+
* Run your test suite on Chewy 7.1 / Elasticsearch 7
|
23
|
+
* Run manual tests on Chewy 7.1 / Elasticsearch 7
|
24
|
+
* Upgrade to Chewy 7.1
|
25
|
+
* Upgrade to Chewy 7.2:
|
26
|
+
* Remove all the the `Chewy::Type` class usages, e.g. remove `CitiesIndex::City` / `CitiesIndex.city`
|
27
|
+
* `CitiesIndex::City.import! ...` becomes `CitiesIndex.import! ...`
|
28
|
+
* Update indexes with simplified DSL:
|
29
|
+
* `define_type` block -> `index_scope` clause
|
30
|
+
* it can be omitted completely, if you don't need to specify the scope or options, e.g. `name`
|
31
|
+
* Remove type names from string representations:
|
32
|
+
* in `update_index` ActiveRecord helper and RSpec matcher, e.g.
|
33
|
+
* `update_index('cities#city')` -> `update_index('cities')`
|
34
|
+
* `update_index(UsersIndex::User)` -> `update_index(UsersIndex)`
|
35
|
+
* in rake tasks (e.g. `rake chewy:update[cities#city]` -> `rake chewy:update[cities]`)
|
36
|
+
* rake tasks output is also changed (e.g. `Imported CitiesIndex::City in 1s, stats: index 3` -> `Imported CitiesIndex in 1s, stats: index 3`)
|
37
|
+
* Use index name instead of type name in loader additional scope
|
38
|
+
* e.g. `CitiesIndex.filter(...).load(city: {scope: City.where(...)})` -> `CitiesIndex.filter(...).load(cities: {scope: City.where(...)})`
|
17
39
|
|
18
40
|
## Chewy 5/Elasticsearch 5 to Chewy 6/Elasticsearch 6
|
19
41
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chewy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toptal, LLC
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-05-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: appraisal
|
@@ -248,6 +248,7 @@ files:
|
|
248
248
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
249
249
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
250
250
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
251
|
+
- ".github/workflows/ruby.yml"
|
251
252
|
- ".gitignore"
|
252
253
|
- ".rspec"
|
253
254
|
- ".rubocop.yml"
|