Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prep work for Elasticsearch 8 upgrade #81

Merged
merged 29 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8776924
Test against updated versions of Ruby.
mrsweaters Jul 29, 2022
bec9365
Add new build steps for ruby 3.
mrsweaters Jul 29, 2022
555d963
Use build_2_7.
mrsweaters Jul 29, 2022
5c1b07d
Bump bundler version.
mrsweaters Jul 29, 2022
ca4510e
Bump bundler version.
mrsweaters Jul 29, 2022
e6ac1d2
Increment version.
mrsweaters Jul 29, 2022
44ac447
Bump bundler version.
mrsweaters Aug 2, 2022
b096fee
Bump bundler.
mrsweaters Aug 2, 2022
8e13afa
Lock down elasticsearch version to < 8.
mrsweaters Aug 2, 2022
eaa0cab
Remove invalid legacy timestamp format when generating new indices.
mrsweaters Aug 2, 2022
88ecce8
Use refresh_index instead of flush_index.
mrsweaters Aug 2, 2022
799b15d
Include type name on mapping for now.
mrsweaters Aug 3, 2022
5a655cd
Try running delete alias manually.
mrsweaters Aug 3, 2022
90b4f33
Update ci config.
mrsweaters Aug 3, 2022
cddbaea
Refresh index on remap.
mrsweaters Aug 3, 2022
13b1e56
Remove ScrollableSearch.
mrsweaters Aug 3, 2022
9fdf677
Update changelog.
mrsweaters Aug 3, 2022
af75269
Add Ruby 3.1
mrsweaters Aug 3, 2022
2dfa236
Don't call SimpleCov.start twice.
mrsweaters Aug 3, 2022
1ae3e0c
Update timecop.
mrsweaters Aug 3, 2022
71cde42
Update changelog formatting.
mrsweaters Aug 4, 2022
a51b863
Remove focus spec config.
mrsweaters Aug 4, 2022
b0bd07d
Remove comment.
mrsweaters Aug 4, 2022
5a1b0d1
Test specs against removing ignore 404.
mrsweaters Aug 4, 2022
4afbdb0
Update changelog.
mrsweaters Aug 4, 2022
e3ed1bb
Update changelog for one extra bump.
mrsweaters Aug 4, 2022
4927d20
Bump version to 0.14.0.jhumphreys.1
mrsweaters Aug 4, 2022
9cc38e1
update bundled version.
mrsweaters Aug 4, 2022
cbb2728
Bump version to final.
mrsweaters Aug 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 43 additions & 42 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,47 @@ orbs:
gem: doximity/gem-publisher@0

executors:

# used for building the gem
ruby-latest:
resource_class: small
docker:
- image: cimg/ruby:2.7
- image: cimg/ruby:3.1
environment:
BUNDLE_VERSION: "~> 1.17"
BUNDLE_VERSION: '~> 2.3.4'

# used for testing the gem:
ruby_2_5:
ruby_2_7:
resource_class: small
docker:
- image: cimg/ruby:2.5
- image: cimg/ruby:2.7
environment:
BUNDLE_VERSION: "~> 1.17"
- image: elastic/elasticsearch:6.8.2
BUNDLE_VERSION: '~> 2.3.4'
- image: docker.elastic.co/elasticsearch/elasticsearch:7.17.3
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
- discovery.type=single-node
- xpack.security.enabled=false
ruby_2_6:
ruby_3_0:
resource_class: small
docker:
- image: cimg/ruby:2.6
- image: cimg/ruby:3.0
environment:
BUNDLE_VERSION: "~> 1.17"
- image: elastic/elasticsearch:6.8.2
BUNDLE_VERSION: '~> 2.3.4'
- image: docker.elastic.co/elasticsearch/elasticsearch:7.17.3
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
- discovery.type=single-node
- xpack.security.enabled=false
ruby_2_7:

ruby_3_1:
resource_class: small
docker:
- image: cimg/ruby:2.7
- image: cimg/ruby:3.1
environment:
BUNDLE_VERSION: "~> 1.17"
- image: elastic/elasticsearch:6.8.2
BUNDLE_VERSION: '~> 2.3.4'
- image: docker.elastic.co/elasticsearch/elasticsearch:7.17.3
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
- discovery.type=single-node
- xpack.security.enabled=false

Expand All @@ -69,8 +69,8 @@ version_tags_only: &version_tags_only
only: /^v.*/

jobs:
build_2_5:
executor: ruby_2_5
build_2_7:
executor: ruby_2_7
steps:
- checkout
- run:
Expand All @@ -79,12 +79,12 @@ jobs:
gem install bundler --version "${BUNDLE_VERSION}" --force
- restore_cache:
keys:
- v1-bundle-ruby_2_5-{{ checksum "Gemfile.lock" }}
- v2-bundle-ruby_2_7-{{ checksum "Gemfile.lock" }}
- run:
name: Install Ruby Dependencies
command: bundle check --path=vendor/bundle || bundle install --local --frozen --path=vendor/bundle --jobs=4 --retry=3
- save_cache:
key: v1-bundle-ruby_2_5-{{ checksum "Gemfile.lock" }}
key: v2-bundle-ruby_2_7-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- run:
Expand All @@ -97,8 +97,8 @@ jobs:
root: .
paths:
- vendor/bundle
build_2_6:
executor: ruby_2_6
build_3_0:
executor: ruby_3_0
steps:
- checkout
- run:
Expand All @@ -107,12 +107,12 @@ jobs:
gem install bundler --version "${BUNDLE_VERSION}" --force
- restore_cache:
keys:
- v1-bundle-ruby_2_6-{{ checksum "Gemfile.lock" }}
- v2-bundle-ruby_3_0-{{ checksum "Gemfile.lock" }}
- run:
name: Install Ruby Dependencies
command: bundle check --path=vendor/bundle || bundle install --local --frozen --path=vendor/bundle --jobs=4 --retry=3
- save_cache:
key: v1-bundle-ruby_2_6-{{ checksum "Gemfile.lock" }}
key: v2-bundle-ruby_3_0-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- run:
Expand All @@ -125,8 +125,9 @@ jobs:
root: .
paths:
- vendor/bundle
build_2_7:
executor: ruby_2_7

build_3_1:
executor: ruby_3_1
steps:
- checkout
- run:
Expand All @@ -135,12 +136,12 @@ jobs:
gem install bundler --version "${BUNDLE_VERSION}" --force
- restore_cache:
keys:
- v1-bundle-ruby_2_7-{{ checksum "Gemfile.lock" }}
- v2-bundle-ruby_3_1-{{ checksum "Gemfile.lock" }}
- run:
name: Install Ruby Dependencies
command: bundle check --path=vendor/bundle || bundle install --local --frozen --path=vendor/bundle --jobs=4 --retry=3
- save_cache:
key: v1-bundle-ruby_2_7-{{ checksum "Gemfile.lock" }}
key: v2-bundle-ruby_3_1-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- run:
Expand All @@ -158,33 +159,33 @@ workflows:
version: 2
trunk:
jobs:
- build_2_5:
- build_2_7:
<<: *master_only
- build_2_6:
- build_3_0:
<<: *master_only
- build_2_7:
- build_3_1:
<<: *master_only
- gem/build:
<<: *master_only
executor: ruby-latest
name: gem-build
requires:
- build_2_5
- build_3_1

pull-requests:
jobs:
- build_2_5:
- build_2_7:
<<: *pr_only
- build_2_6:
- build_3_0:
<<: *pr_only
- build_2_7:
- build_3_1:
<<: *pr_only
- gem/build:
<<: *pr_only
executor: ruby-latest
name: gem-build
requires:
- build_2_5
- build_3_1
- pre-release-approval:
<<: *pr_only
type: approval
Expand All @@ -201,18 +202,18 @@ workflows:

final-release:
jobs:
- build_2_5:
- build_2_7:
<<: *version_tags_only
- build_2_6:
- build_3_0:
<<: *version_tags_only
- build_2_7:
- build_3_1:
<<: *version_tags_only
- gem/build:
<<: *version_tags_only
executor: ruby-latest
name: gem-build
requires:
- build_2_5
- build_3_1
- gem/publish:
<<: *version_tags_only
name: gem-publish
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [0.14.0.jhumphreys] - 2022-08-03
### Changed
- Use `refresh` instead of `flush` where search is expected to be updated
- Drop support for Ruby 2.5 and 2.6
- Add support for Ruby 2.7 and 3.0, build against Ruby 3.1
- Set `search_type` to `query_then_fetch` as we no longer support Elasticsearch version < 7.0
- Set `include_type_name` when fetching the mapping. Will be removed in the next version to support ES version 8.
- Index names automatically use the new timestamp format when creating an index.
- Don't raise an exception when index doesn't exist when calling `missing?` in SingleIndex strategy.

## [0.13.5] - 2020-05-21
### Changed
Expand Down
87 changes: 53 additions & 34 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,48 +1,68 @@
PATH
remote: .
specs:
es-elasticity (0.13.5)
activemodel (>= 4.0.0, < 7)
activerecord (>= 4.0.0, < 7)
activesupport (>= 4.0.0, < 7)
elasticsearch (>= 1.0)
es-elasticity (0.14.0.jhumphreys)
activemodel (>= 5.2.0, < 7.1)
activerecord (>= 5.2.0, < 7.1)
activesupport (>= 5.2.0, < 7.1)
elasticsearch (>= 7, < 8)

GEM
remote: https://artifacts.dox.support/repository/gems/
specs:
activemodel (6.0.3.1)
activesupport (= 6.0.3.1)
activerecord (6.0.3.1)
activemodel (= 6.0.3.1)
activesupport (= 6.0.3.1)
activesupport (6.0.3.1)
activemodel (7.0.3.1)
activesupport (= 7.0.3.1)
activerecord (7.0.3.1)
activemodel (= 7.0.3.1)
activesupport (= 7.0.3.1)
activesupport (7.0.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
byebug (11.0.1)
codeclimate-test-reporter (1.0.9)
simplecov (<= 0.13)
coderay (1.1.2)
concurrent-ruby (1.1.6)
concurrent-ruby (1.1.10)
diff-lcs (1.3)
elasticsearch (7.7.0)
elasticsearch-api (= 7.7.0)
elasticsearch-transport (= 7.7.0)
elasticsearch-api (7.7.0)
elasticsearch (7.17.1)
elasticsearch-api (= 7.17.1)
elasticsearch-transport (= 7.17.1)
elasticsearch-api (7.17.1)
multi_json
elasticsearch-transport (7.7.0)
elasticsearch-transport (7.17.1)
faraday (~> 1)
multi_json
faraday (1.0.1)
multipart-post (>= 1.2, < 3)
i18n (1.8.2)
faraday (1.10.0)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0)
faraday-multipart (~> 1.0)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.0)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
faraday-retry (~> 1.0)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
method_source (0.9.2)
minitest (5.14.1)
multi_json (1.14.1)
multipart-post (2.1.1)
minitest (5.16.2)
multi_json (1.15.0)
multipart-post (2.2.3)
oj (3.10.0)
pry (0.12.2)
coderay (~> 1.1.0)
Expand All @@ -63,21 +83,20 @@ GEM
rspec-support (3.1.2)
rspec_junit_formatter (0.4.1)
rspec-core (>= 2, < 4, != 2.12.0)
ruby2_keywords (0.0.5)
simplecov (0.7.1)
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
simplecov-html (0.7.1)
thread_safe (0.3.6)
timecop (0.9.1)
tzinfo (1.2.7)
thread_safe (~> 0.1)
zeitwerk (2.3.0)
timecop (0.9.5)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)

PLATFORMS
ruby

DEPENDENCIES
bundler (~> 1.7)
bundler (~> 2.3.4)
byebug
codeclimate-test-reporter
es-elasticity!
Expand All @@ -91,4 +110,4 @@ DEPENDENCIES
timecop

BUNDLED WITH
1.17.3
2.3.4
10 changes: 5 additions & 5 deletions es-elasticity.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_development_dependency "bundler", "~> 1.7"
spec.add_development_dependency "bundler", "~> 2.3.4"
spec.add_development_dependency "byebug"
spec.add_development_dependency "codeclimate-test-reporter"
spec.add_development_dependency "oj"
Expand All @@ -33,8 +33,8 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "simplecov", "~> 0.7.1"
spec.add_development_dependency "timecop"

spec.add_dependency "activemodel", ">= 4.0.0", "< 7"
spec.add_dependency "activerecord", ">= 4.0.0", "< 7"
spec.add_dependency "activesupport", ">= 4.0.0", "< 7"
spec.add_dependency "elasticsearch", ">= 1.0"
spec.add_dependency "activemodel", ">= 5.2.0", "< 7.1"
spec.add_dependency "activerecord", ">= 5.2.0", "< 7.1"
spec.add_dependency "activesupport", ">= 5.2.0", "< 7.1"
spec.add_dependency "elasticsearch", ">= 7", "< 8"
end
15 changes: 0 additions & 15 deletions lib/elasticity/scrollable_search.rb

This file was deleted.

Loading