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

Ruby 3.0 preview2 support #1281

Merged
merged 28 commits into from
Dec 21, 2020
Merged

Ruby 3.0 preview2 support #1281

merged 28 commits into from
Dec 21, 2020

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented Dec 10, 2020

This PR adds support Ruby the latest Ruby 3.0 build (preview2). Given the close proximity of the final release, we don't foresee any major compatibility issues with the stable release.

We added two variants of Ruby 3.0 to CI: 3.0 and 3.0-jit, to allow us to test if the new JIT affects the tracer correctness and performance.

Overall, there was only one change in the Sinatra integration necessary for the tracer to support Ruby 3.0.

Temporarily disabled features for Ruby 3.0

I'm holding off updating our GettingStarted.md, given the lack of support for Rails and the fact that full Ruby 3.0 is not here yet. I tried to update our docs while mentioning the lack of Rails support, but I don't believe it reads very clearly.

@@ -53,13 +53,8 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'pimpmychangelog', '>= 0.1.2'
spec.add_development_dependency 'appraisal', '~> 2.2'
spec.add_development_dependency 'yard', '~> 0.9'
spec.add_development_dependency 'webmock', '~> 2.0'
spec.add_development_dependency 'webmock', '>= 3.10.0'
Copy link
Member Author

@marcotc marcotc Dec 18, 2020

Choose a reason for hiding this comment

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

We need webmock >= 3 for Ruby 3.0 support. Thankfully it works correctly with all our supported Rubies.

Comment on lines -58 to -62
if RUBY_PLATFORM != 'java'
spec.add_development_dependency 'sqlite3', '~> 1.3.6'
else
spec.add_development_dependency 'jdbc-sqlite3', '~> 3'
end
Copy link
Member Author

Choose a reason for hiding this comment

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

I did the overdue work of moving sqlite3 to our Appraisal file: we cannot run all our test scenarios with version ~> 1.3.6 anymore. The version of sqlite3 is now correctly handled in each Appraisal scenario.

Comment on lines +12 to +23
- &job_parameters
parameters:
ruby_version:
description: Ruby version
type: string
image:
description: Docker image location
type: string
jit:
description: Jit enabled?
type: boolean
default: false
Copy link
Member Author

Choose a reason for hiding this comment

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

Because I had to add a new variant 3.0 with jit, I found it easier to extract the parameters: block into a shared snippet.

With this I noticed a few more copy/paste patterns in this configuration and extracted the ones that were trivial (docker and environment).

@marcotc marcotc self-assigned this Dec 18, 2020
@marcotc marcotc added core Involves Datadog core libraries integrations Involves tracing integrations dev/ci Involves CircleCI, GitHub Actions, or GitLab and removed core Involves Datadog core libraries labels Dec 18, 2020
@marcotc marcotc changed the title [WIP] Ruby 3.0 support Ruby 3.0 preview2 support Dec 18, 2020
@codecov-io
Copy link

Codecov Report

Merging #1281 (8719d86) into master (d20c6a1) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1281   +/-   ##
=======================================
  Coverage   97.80%   97.80%           
=======================================
  Files         751      751           
  Lines       35668    35670    +2     
=======================================
+ Hits        34885    34887    +2     
  Misses        783      783           
Impacted Files Coverage Δ
...pec/ddtrace/diagnostics/environment_logger_spec.rb 100.00% <ø> (ø)
lib/ddtrace/contrib/sinatra/tracer_middleware.rb 98.03% <100.00%> (ø)
spec/ddtrace/contrib/que/tracer_spec.rb 100.00% <100.00%> (ø)
spec/ddtrace/contrib/rails/support/rails6.rb 94.59% <100.00%> (+0.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d20c6a1...8719d86. Read the comment docs.

@marcotc marcotc marked this pull request as ready for review December 18, 2020 20:18
@marcotc marcotc requested a review from a team December 18, 2020 20:18
Copy link
Contributor

@ericmustin ericmustin left a comment

Choose a reason for hiding this comment

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

I think this is good and fine to merge, i do think we should have something in gettingstarted.md about ruby3. Whether or not we have it, people are going to ask, so we'll need to have language prepared for it anyway.

@marcotc
Copy link
Member Author

marcotc commented Dec 21, 2020

Thank you, @ericmustin! I'll merge this PR to get 3.0 support going, and I'll ensure there's documentation changes in our GettingStarted.md before we release it.

@marcotc marcotc merged commit a5a7570 into master Dec 21, 2020
@marcotc marcotc deleted the add-ruby-3 branch December 21, 2020 16:30
@github-actions github-actions bot added this to the 0.44.0 milestone Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev/ci Involves CircleCI, GitHub Actions, or GitLab integrations Involves tracing integrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants