-
Notifications
You must be signed in to change notification settings - Fork 85
Support only Ruby 3.2 and onward #572
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
Conversation
|
This will necessitate a minor version bump to 0.23 to not surprise folks who have pinned to 0.22 |
|
The PR is failing CI on some gRPC tests that seem to not be cleaning up after themselves. To trigger this locally, run: |
There was a problem hiding this 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
casperisfine
left a comment
There was a problem hiding this 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.
chastell
left a comment
There was a problem hiding this 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.
b77dfe2 to
38da14c
Compare
Thanks, rebased to achieve this. |

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-versionfile 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::Unavailableinstead ofGRPC::DeadlineExceeded