Skip to content

Commit

Permalink
Merge pull request #91 from block/myron/ruby-3.4
Browse files Browse the repository at this point in the history
Officially support Ruby 3.4.
  • Loading branch information
myronmarston authored Jan 6, 2025
2 parents 84dda9b + 63c5099 commit b7cf1f8
Show file tree
Hide file tree
Showing 35 changed files with 115 additions and 112 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
ruby:
- "3.2"
- "3.3"
- "3.4"
datastore:
- "elasticsearch:8.16.1"
- "opensearch:2.18.0"
Expand All @@ -37,13 +38,13 @@ jobs:
# these others against every combination of `ruby` and `datastore` so we just run each with one
# configuration here.
- build_part: "run_misc_checks"
ruby: "3.3"
ruby: "3.4"
datastore: "elasticsearch:8.16.1"
- build_part: "run_specs_with_vcr"
ruby: "3.3"
ruby: "3.4"
datastore: "elasticsearch:8.16.1"
- build_part: "run_specs_file_by_file"
ruby: "3.3"
ruby: "3.4"
datastore: "elasticsearch:8.16.1"

steps:
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ This guide is for you.

## Development Prerequisites

| Requirement | Tested Version | Installation Instructions |
|----------------|----------------|---------------------------------------------------------------------------|
| Ruby | 3.2.x, 3.3.x | [ruby-lang.org](https://www.ruby-lang.org/en/documentation/installation/) |
| Docker Engine | 27.x | [docker.com](https://docs.docker.com/engine/install/) |
| Docker Compose | 2.29.x | [docker.com](https://docs.docker.com/compose/install/) |
| Requirement | Tested Version | Installation Instructions |
|----------------|---------------------|---------------------------------------------------------------------------|
| Ruby | 3.2.x, 3.3.x, 3.4.x | [ruby-lang.org](https://www.ruby-lang.org/en/documentation/installation/) |
| Docker Engine | 27.x | [docker.com](https://docs.docker.com/engine/install/) |
| Docker Compose | 2.29.x | [docker.com](https://docs.docker.com/compose/install/) |

### Ruby

Expand All @@ -26,7 +26,7 @@ You may verify your `ruby` installation via the terminal:

```bash
$ ruby -v
ruby 3.3.4 (2024-07-09 revision be1089c8ec) [arm64-darwin23]
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24]
```

If you do not have Ruby, we recommend installing it using one of the following:
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ group :development do
gem "coderay", "~> 1.1"
gem "factory_bot", "~> 6.4"
gem "faker", "~> 3.5"
gem "flatware-rspec", "~> 2.3"
gem "flatware-rspec", "~> 2.3", ">= 2.3.4"
gem "httpx", "~> 1.3"
gem "method_source", "~> 1.1"
gem "rubocop-factory_bot", "~> 2.26"
Expand Down Expand Up @@ -44,6 +44,7 @@ repo_root = ::Pathname.new(__dir__).ascend.find { |dir| ::Dir.exist?("#{dir}/ela

# `tmp` and `log` are git-ignored but many of our build tasks and scripts expect them to exist.
# We create them here since `Gemfile` evaluation happens before anything else.
require "fileutils"
::FileUtils.mkdir_p("#{repo_root}/log")
::FileUtils.mkdir_p("#{repo_root}/tmp")

Expand Down
50 changes: 7 additions & 43 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -274,17 +274,10 @@ GEM
faraday_middleware-aws-sigv4 (1.0.1)
aws-sigv4 (~> 1.0)
faraday (>= 2.0, < 3)
ffi (1.17.0)
ffi (1.17.0-aarch64-linux-gnu)
ffi (1.17.0-aarch64-linux-musl)
ffi (1.17.0-arm-linux-gnu)
ffi (1.17.0-arm-linux-musl)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x86-linux-gnu)
ffi (1.17.0-x86-linux-musl)
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
ffi (1.17.0-x86_64-linux-musl)
ffi (1.17.1)
ffi (1.17.1-arm-linux-gnu)
ffi (1.17.1-arm-linux-musl)
ffi (1.17.1-arm64-darwin)
fiber-storage (1.0.0)
fileutils (1.7.3)
filewatcher (2.1.0)
Expand All @@ -297,11 +290,6 @@ GEM
rspec (>= 3.6)
forwardable-extended (2.6.0)
google-protobuf (3.25.5)
google-protobuf (3.25.5-aarch64-linux)
google-protobuf (3.25.5-arm64-darwin)
google-protobuf (3.25.5-x86-linux)
google-protobuf (3.25.5-x86_64-darwin)
google-protobuf (3.25.5-x86_64-linux)
graphql (2.4.8)
base64
fiber-storage
Expand Down Expand Up @@ -384,7 +372,7 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rbs (3.8.0)
rbs (3.8.1)
logger
regexp_parser (2.10.0)
rexml (3.4.0)
Expand Down Expand Up @@ -432,10 +420,6 @@ GEM
rake (>= 13)
sass-embedded (1.77.5-aarch64-linux-android)
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.77.5-aarch64-linux-gnu)
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.77.5-aarch64-linux-musl)
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.77.5-aarch64-mingw-ucrt)
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.77.5-arm-linux-androideabi)
Expand All @@ -456,22 +440,12 @@ GEM
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.77.5-x86-linux-android)
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.77.5-x86-linux-gnu)
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.77.5-x86-linux-musl)
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.77.5-x86-mingw-ucrt)
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.77.5-x86_64-cygwin)
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.77.5-x86_64-darwin)
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.77.5-x86_64-linux-android)
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.77.5-x86_64-linux-gnu)
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.77.5-x86_64-linux-musl)
google-protobuf (>= 3.25, < 5.0)
securerandom (0.4.1)
simplecov (0.22.0)
docile (~> 1.1)
Expand Down Expand Up @@ -533,33 +507,23 @@ GEM
yard

PLATFORMS
aarch64-linux
aarch64-linux-android
aarch64-linux-gnu
aarch64-linux-musl
aarch64-mingw-ucrt
arm-linux-androideabi
arm-linux-gnu
arm-linux-gnueabihf
arm-linux-musl
arm-linux-musleabihf
arm64-darwin
arm64-darwin-24
riscv64-linux-android
riscv64-linux-gnu
riscv64-linux-musl
ruby
x86-cygwin
x86-linux
x86-linux-android
x86-linux-gnu
x86-linux-musl
x86-mingw-ucrt
x86_64-cygwin
x86_64-darwin
x86_64-linux
x86_64-linux-android
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
aws_lambda_ric (~> 2.0)
Expand Down Expand Up @@ -590,7 +554,7 @@ DEPENDENCIES
faker (~> 3.5)
faraday (~> 2.12)
filewatcher (~> 2.1)
flatware-rspec (~> 2.3)
flatware-rspec (~> 2.3, >= 2.3.4)
httpx (~> 1.3)
jekyll (~> 4.3)
method_source (~> 1.1)
Expand Down
2 changes: 1 addition & 1 deletion elasticgraph-admin/elasticgraph-admin.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"
spec.required_ruby_version = [">= 3.2", "< 3.5"]

spec.add_dependency "elasticgraph-datastore_core", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-indexer", ElasticGraph::VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"
spec.required_ruby_version = [">= 3.2", "< 3.5"]

spec.add_dependency "rake", "~> 13.2"
spec.add_dependency "elasticgraph-admin", ElasticGraph::VERSION
Expand Down
2 changes: 1 addition & 1 deletion elasticgraph-apollo/elasticgraph-apollo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"
spec.required_ruby_version = [">= 3.2", "< 3.5"]

spec.add_dependency "elasticgraph-graphql", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-support", ElasticGraph::VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,15 @@ def adapter
self
end

# :nocov: -- these methods are not called on an adapter when `indexed?` returns `false`.
def customize_query(query, representations)
nil
end

def index_search_hits(response)
nil
end
# :nocov:

def identify_matching_hit(indexed_search_hits, representation, context:, index:)
representation.representation_hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"
spec.required_ruby_version = [">= 3.2", "< 3.5"]

spec.add_dependency "elasticgraph-schema_artifacts", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-support", ElasticGraph::VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"
spec.required_ruby_version = [">= 3.2", "< 3.5"]

spec.add_dependency "elasticgraph-support", ElasticGraph::VERSION
spec.add_dependency "elasticsearch", "~> 8.16"
Expand Down
2 changes: 1 addition & 1 deletion elasticgraph-graphql/elasticgraph-graphql.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"
spec.required_ruby_version = [">= 3.2", "< 3.5"]

spec.add_dependency "elasticgraph-datastore_core", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-schema_artifacts", ElasticGraph::VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class GraphQL
end

it "inspects nicely, but redacts filters since they could contain PII" do
expect(new_query(filter: {"ssn" => {"equal_to_any_of" => ["123-45-6789"]}}, individual_docs_needed: true).inspect).to eq(<<~EOS.strip)
#<ElasticGraph::GraphQL::DatastoreQuery index="widgets_rollover__*" size=#{default_page_size + 1} sort=[{"id"=>{"order"=>"asc", "missing"=>"_first"}}] track_total_hits=false query=<REDACTED> _source=false>
expect(new_query(filter: {"ssn" => {"equal_to_any_of" => ["123-45-6789"]}}, individual_docs_needed: true).inspect).to eq(inspect_output_of(<<~EOS.strip))
#<ElasticGraph::GraphQL::DatastoreQuery index="widgets_rollover__*" size=#{default_page_size + 1} sort=[{"id" => {"order" => "asc", "missing" => "_first"}}] track_total_hits=false query=<REDACTED> _source=false>
EOS
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class GraphQL
expect {
router.msearch([query1, query2])
}.to raise_error(Errors::SearchFailedError, a_string_including(
"2) ", '{"index":"widgets"}', '{"bad stuff"=>"happened"}'
"2) ", '{"index":"widgets"}', inspect_output_of('{"bad stuff" => "happened"}')
).and(excluding(
# These are parts of the body of the request, which we don't want included because it could contain PII!.
"track_total_hits", "size"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"
spec.required_ruby_version = [">= 3.2", "< 3.5"]

spec.add_dependency "elasticgraph-graphql", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-lambda_support", ElasticGraph::VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"
spec.required_ruby_version = [">= 3.2", "< 3.5"]

spec.add_dependency "elasticgraph-datastore_core", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-graphql", ElasticGraph::VERSION
Expand Down
2 changes: 1 addition & 1 deletion elasticgraph-indexer/elasticgraph-indexer.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"
spec.required_ruby_version = [">= 3.2", "< 3.5"]

spec.add_dependency "elasticgraph-datastore_core", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-json_schema", ElasticGraph::VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"
spec.required_ruby_version = [">= 3.2", "< 3.5"]

spec.add_dependency "elasticgraph-datastore_core", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-lambda_support", ElasticGraph::VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"
spec.required_ruby_version = [">= 3.2", "< 3.5"]

spec.add_dependency "elasticgraph-indexer", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-lambda_support", ElasticGraph::VERSION
Expand Down
2 changes: 1 addition & 1 deletion elasticgraph-json_schema/elasticgraph-json_schema.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"
spec.required_ruby_version = [">= 3.2", "< 3.5"]

spec.add_dependency "elasticgraph-support", ElasticGraph::VERSION
spec.add_dependency "json_schemer", "~> 2.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"
spec.required_ruby_version = [">= 3.2", "< 3.5"]

spec.add_dependency "elasticgraph-opensearch", ElasticGraph::VERSION
spec.add_dependency "faraday_middleware-aws-sigv4", "~> 1.0"
Expand Down
2 changes: 1 addition & 1 deletion elasticgraph-local/elasticgraph-local.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"
spec.required_ruby_version = [">= 3.2", "< 3.5"]

spec.add_dependency "elasticgraph-admin", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-graphql", ElasticGraph::VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,21 @@ module Local
list_datastore_management_tasks do |t|
t.env_port_mapping = {local: "123"}
end
}.to raise_error a_string_including('`env_port_mapping` has invalid ports: {:local=>"123"}')
}.to raise_error a_string_including(
"`env_port_mapping` has invalid ports: ",
inspect_output_of('{local: "123"}')
)
end

it "raises an error when a port number is too high" do
expect {
list_datastore_management_tasks do |t|
t.env_port_mapping = {local: "45000"}
end
}.to raise_error a_string_including('`env_port_mapping` has invalid ports: {:local=>"45000"}')
}.to raise_error a_string_including(
"`env_port_mapping` has invalid ports: ",
inspect_output_of('{local: "45000"}')
)
end

context "when `opensearch_versions` is empty" do
Expand Down
2 changes: 1 addition & 1 deletion elasticgraph-opensearch/elasticgraph-opensearch.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"
spec.required_ruby_version = [">= 3.2", "< 3.5"]

spec.add_dependency "elasticgraph-support", ElasticGraph::VERSION
spec.add_dependency "faraday", "~> 2.12"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
end - [".rspec", "Gemfile", ".yardopts"]
end

spec.required_ruby_version = "~> 3.2"
spec.required_ruby_version = [">= 3.2", "< 3.5"]

spec.add_dependency "elasticgraph-graphql", ElasticGraph::VERSION
spec.add_dependency "elasticgraph-schema_artifacts", ElasticGraph::VERSION
Expand Down
Loading

0 comments on commit b7cf1f8

Please sign in to comment.