Skip to content

Commit

Permalink
Merge pull request #81 from doximity/MOFONETNAV-167
Browse files Browse the repository at this point in the history
Prep work for Elasticsearch 8 upgrade
  • Loading branch information
mrsweaters committed Aug 4, 2022
2 parents 6ecbe10 + cbb2728 commit bf02d96
Show file tree
Hide file tree
Showing 56 changed files with 145 additions and 150 deletions.
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [0.14.0] - 2022-08-04
### 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.

## [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)
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.

0 comments on commit bf02d96

Please sign in to comment.