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

Allow Rails patching to occur if Railties are loaded #1054

Merged
merged 1 commit into from
May 26, 2020

Conversation

delner
Copy link
Contributor

@delner delner commented May 26, 2020

Per #993, when users run Rails applications without gem 'rails' and opt to load gems manually, the Rails patcher aborts patching because it can't find the Rails version in the Rails gem.

This had to do with some changes we made to add stricter version checks for integrations in 0.33.0. It was checking if Gem.loaded_specs['rails'] was loaded, and when it didn't find it, it would assume Rails wasn't present.

This pull request changes this check to also see if gem 'railties' are loaded, which are used in Rails applications, regardless of whether gem 'rails' is included or not. If railties are present, it will attempt Rails patching.

@delner delner added bug Involves a bug integrations Involves tracing integrations community Was opened by a community member labels May 26, 2020
@delner delner requested review from marcotc and a team May 26, 2020 16:53
@delner delner self-assigned this May 26, 2020
@delner delner force-pushed the fix/rails_patching_with_railties branch 2 times, most recently from f0da53b to 248ecd7 Compare May 26, 2020 16:57
Copy link
Member

@marcotc marcotc left a comment

Choose a reason for hiding this comment

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

Nice stuff! A small comment only.

lib/ddtrace/contrib/rails/integration.rb Outdated Show resolved Hide resolved
@delner delner force-pushed the fix/rails_patching_with_railties branch from 248ecd7 to e3c088c Compare May 26, 2020 17:57
@delner delner force-pushed the fix/rails_patching_with_railties branch from e3c088c to ab253d7 Compare May 26, 2020 17:57
Copy link
Member

@marcotc marcotc left a comment

Choose a reason for hiding this comment

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

🔥

@delner delner merged commit 9595dc2 into master May 26, 2020
@delner delner deleted the fix/rails_patching_with_railties branch May 26, 2020 20:27
@bheemreddy181-zz
Copy link

@delner when can we expect a release on this ?

@marcotc marcotc added this to the 0.36.0 milestone May 27, 2020
@marcotc
Copy link
Member

marcotc commented May 27, 2020

Hi @bheemreddy181, it was released just now :) https://github.com/DataDog/dd-trace-rb/releases/tag/v0.36.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Involves a bug community Was opened by a community member integrations Involves tracing integrations
Projects
None yet
3 participants