Skip to content

Conversation

@iandelahorne
Copy link
Contributor

@iandelahorne iandelahorne commented Feb 28, 2025

We noticed that Dependabot has stopped being able to issue updates due to the gemspec specifying Ruby 2.7+, but we have optional dependencies that require ruby 3.1+. While our .ruby-version file specifies 3.2, Dependabot only reads the gemspec and not the ruby-version file. This is a known bug (dependabot/dependabot-core#10108) that has not been addressed.

Looking at Ruby's deprecation schedule, 2.7 was EOL in 2023 and 3.1 will be EOL in a month. This gives us good reason to support 3.2+ going forward, bringing the gemspec in line with our testing versions.

This will necessitate a minor version bump to 0.23 to not surprise folks who have pinned to 0.22

In this, we also needed to bump dependencies so they would work with newer ruby versions. In this, we ran into gRPC tests not exiting despite passing, so a lot of defensiveness has been added to those tests to ensure that we're actually closing everything and cleaning up after ourselves. In addition, we noticed that when running tests locally with docker-compose, gRPC would return GRPC::Unavailable instead of GRPC::DeadlineExceeded

  • Bump gemspec to use Ruby 3.2+
  • Drop 2.7 and 3.0 from testing, add 3.3 and 3.4
  • Bump toxiproxy test container from 2.5.0 -> 2.12.0
  • Bump gRPC to 1.71.0
  • Bump trilogy to 2.9
  • Update lockfiles
  • Add timeouts in CI
  • Update rubocop to use plugins
  • Style fixes
  • Fix gRPC test to exit cleanly.

@iandelahorne
Copy link
Contributor Author

This will necessitate a minor version bump to 0.23 to not surprise folks who have pinned to 0.22

@iandelahorne
Copy link
Contributor Author

The PR is failing CI on some gRPC tests that seem to not be cleaning up after themselves. To trigger this locally, run:

docker-compose -f ./.devcontainer/docker-compose.yml run -e TEST=test/adapters/grpc_test.rb -e TESTOPTS="-v --name=test_errors_are_tagged_with_the_resource_identifier" -e BUNDLE_GEMFILE=gemfiles/grpc.gemfile semian bash -c "bundle config path vendor/bundle; bundle install; bundle exec rake test"

@iandelahorne iandelahorne requested review from a team, alexpark20, casperisfine, Copilot, dakmcinnis, jakeshopify and ollietreend and removed request for a team April 23, 2025 18:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the project to require Ruby 3.2+ while bumping several dependencies and improving gRPC test robustness. Key changes include updating the gemspec Ruby version, modifying gRPC tests for improved cleanup and error handling, and bumping dependency versions for grpc, trilogy, and toxiproxy.

Reviewed Changes

Copilot reviewed 21 out of 25 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/adapters/grpc_test.rb Improved gRPC test setup/teardown and extended exception assertions.
test/adapters/activerecord_trilogy_adapter_test.rb Corrected a method call to use raw_connection instead of connection.
semian.gemspec Updated required_ruby_version to ">= 3.2.0".
lib/semian/mysql2.rb Removed .freeze from a regex constant (QUERY_ALLOWLIST).
lib/semian/circuit_breaker.rb Minor cleanup of formatting.
lib/semian/activerecord_trilogy_adapter.rb Removed .freeze from a regex constant (QUERY_ALLOWLIST).
Gemfile Bumped dependency versions and added new gems as needed.
.rubocop.yml Updated configuration syntax to use plugins.
.github/workflows/test.yml Updated CI Ruby versions and toxiproxy image along with test timeouts.
.devcontainer/docker-compose.yml Updated toxiproxy image version.
Files not reviewed (4)
  • .ruby-version: Language not supported
  • dockerfiles/semian-ci: Language not supported
  • gemfiles/grpc.gemfile: Language not supported
  • gemfiles/mysql2.gemfile: Language not supported

Copy link
Contributor

@casperisfine casperisfine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No opinion on GRPC. Other than that LGTM, a cleaner git history would be nice though.

Copy link
Contributor

@chastell chastell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We noticed that Dependabot has stopped being able to issue updates due to the gemspec specifying Ruby 2.7+, but we have
optional dependencies that require ruby 3.1+. While our `.ruby-version` file specifies 3.2, Dependabot only reads the
gemspec and not the ruby-version file. This is a known bug (dependabot/dependabot-core#10108)
that has not been addressed.

Looking at Ruby's [deprecation schedule](https://www.ruby-lang.org/en/downloads/branches/), 2.7 was EOL in 2023 and 3.1
will be EOL in a month. This gives us good reason to support 3.2+ going forward, bringing the gemspec in line with our
testing versions.

In this, we also needed to bump dependencies so they would work with newer ruby versions. In this, we ran into gRPC
tests not exiting despite passing, so a lot of defensiveness has been added to those tests to ensure that we're actually
closing everything and cleaning up after ourselves. In addition, we noticed that when running tests locally with
docker-compose, gRPC would return `GRPC::Unavailable` instead of `GRPC::DeadlineExceeded`

- Bump gemspec to use Ruby 3.2+
- Drop 2.7 and 3.0 from testing, add 3.3 and 3.4
- Bump toxiproxy test container from 2.5.0 -> 2.12.0
- Bump gRPC to 1.71.0
- Bump trilogy to 2.9
- Update lockfiles
- Add timeouts in CI
- Update rubocop to use plugins
- Style fixes
- Fix gRPC test to exit cleanly.
@iandelahorne iandelahorne force-pushed the ian/bump-ruby-version branch from b77dfe2 to 38da14c Compare April 24, 2025 17:41
@iandelahorne
Copy link
Contributor Author

No opinion on GRPC. Other than that LGTM, a cleaner git history would be nice though.

Thanks, rebased to achieve this.

@iandelahorne iandelahorne merged commit 15d6db2 into main Apr 24, 2025
32 checks passed
@iandelahorne iandelahorne deleted the ian/bump-ruby-version branch April 24, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants