Skip to content
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

Merged
merged 10 commits into from
Jun 3, 2024
Merged

CI: test with Ruby v3.4.0-preview1 #2663

merged 10 commits into from
Jun 3, 2024

Conversation

fallwith
Copy link
Contributor

@fallwith fallwith commented May 28, 2024

  • Introduce nightly testing against Ruby v3.4.0-preview1
  • Update elasticsearch instrumentation to be Ruby 3.4+ compatible
  • Update various test environment 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

Test with Ruby v3.4.0-preview1
Copy link
Contributor

@kaylareopelle kaylareopelle left a 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.

fallwith added 9 commits May 29, 2024 12:45
- 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
Copy link
Contributor

SimpleCov Report

Coverage Threshold
Line 93.81% 93%
Branch 71.09% 71%

Copy link
Contributor

@kaylareopelle kaylareopelle left a 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
Copy link
Contributor

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'

Copy link
Contributor Author

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

@fallwith fallwith merged commit 11c2f7e into dev Jun 3, 2024
139 of 140 checks passed
@fallwith fallwith deleted the ruby340preview1 branch June 3, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
3 participants