-
Notifications
You must be signed in to change notification settings - Fork 601
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
CI: test with Ruby v3.4.0-preview1 #2663
Conversation
Test with Ruby v3.4.0-preview1
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.
Thank you!
I don't think this needs to be done here, but we should see if there's an easy way to keep all of our ruby/setup-ruby versions in sync across our workflows.
- Address Ruby v3.4 compatibility issues (ex: `base64`) - Address Ruby v3.5 compatibility issues (ex: `ostruct`)
have every Gemfile contain these gems when Ruby v3.4+ is in play
for the 'rails' suite, make sure `drb` is present for Ruby v3.4+
as was done with the 'rails' suite
Starting with Ruby 3.4... - Methods are quoted with ('') using an opening single tick instead of a backtick - Instance methods have their class names included (MyClass#my_method instead of simply my_method) As a result, the elasticsearch instrumentation we uses that keys off of Ruby caller locations to glean elasticsearch client operation names needs to be flexible.
simplify the operation method name detection a bit
reminder on how to use Docker for local Elasticsearch testing
the regex pattern didn't line up with the source comments and was missing a '?' to signify that the (Ruby v3.4+) specific class name is optional
Permit Ruby v3.4+ to use TimedQueueConnectionPool to perform SQL explains
SimpleCov Report
|
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.
Fantastic documentation on the Elasticsearch Regex! Thank you!!
@@ -22,3 +22,8 @@ gem 'simplecov' if ENV['VERBOSE_TEST_OUTPUT'] | |||
|
|||
gem 'warning' | |||
gem 'loofah', '~> 2.20.0' if RUBY_VERSION >= '2.4.0' && RUBY_VERSION < '2.5.0' | |||
|
|||
if RUBY_VERSION.split('.')[0..1].join('.').to_f >= 3.4 |
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.
Are these environments able to use the ruby_verison_float
method?
Also, it seems a little sacrilegious, but what do you think about using the Gem::Version.new
API to compare Ruby versions? Ruby language versions seem to follow the same process as gem versions. However, it won't allow you to use a float, you'd have to use a string.
Gem::Version.new(RUBY_VERSION) >= '3.4'
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.
Are these environments able to use the ruby_verison_float method?
Given that these are direct entrypoints (as opposed to the Envfile
files), I didn't want to drag in any dependencies.
you'd have to use a string
Yeah, string comparison for math isn't ideal even though we've lucked out with Ruby v1 and v2 never having gone to double digits with the minor version.
Maybe in future we could author a helper method that simply calls Gem::Version.new
on both RUBY_VERSION
and the evaluated Ruby version string. I think we've done that in some places previously inline (without using a method).
Gemfile
files to include gems that were previously included with Ruby as part of the default installation but are no longer included with Ruby 3.4 or 3.5.resolves #2636
resolves #2665
resolves #2670
resolves #2672