-
Notifications
You must be signed in to change notification settings - Fork 248
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
Add fallback for applications that bypass RubyGem to load dependencies #947
Comments
fbogsany
pushed a commit
that referenced
this issue
Sep 22, 2021
* fix: Use Kafka::VERSION fallback for compatibility Some applications bypass Ruby Gems when loading dependencies, which results in a `nil` variable being returned by `Gem.loaded_specs`. This change adds a fallback to use `Kafka::VERSION` constant to check the minimum version when one is not available in Ruby Gems. See #947 * chore: Linter fixes
Instead of falling back programmatically we will rely on gemspec declarations for default compatibility checks: |
Merged
robertlaurin
added a commit
that referenced
this issue
Apr 12, 2022
* feat: RubyGems Fallback The GitHub Monolith bypasses RubyGems when loading dependencies, which results in a `nil` variable being returned by `Gem.loaded_specs`. This change fallsback to using `Gem::Version.new(<VERSION>)` where possible. See #947 Related https://github.com/open-telemetry/opentelemetry-ruby/issues/988#issuecomment-1018676853 * chore: Allow test to run from host machine Prior to this commit developers had to either run tests from within a container, or independently run services from their host machine. Developers may now use docker-compose for all services and run tests from their host machine. Co-authored-by: Robert <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The GitHub monolith bypasses RubyGems to load dependencies and as a result is unable to install any auto-instrumentation gems that use
Gem.loaded_specs
to determine compatibility.@ericmustin implemented several fixes in
ddtrace
to mitigate this issue. We discussed introducing a helper method but then also pointed out that there are some cases where gem authors do not include aVERSION
constant or follow a consistent pattern to namespace the constant.We may want to consider adding a helper similar to what @ericmustin described in one of the PRs:
That would make it so instrumentation authors could do something like this:
Longer term I propose that the
Instrumentation::Base
DSL could possibly include a declaration that uses RubyGems pessimistic version constraint e.g.:Related
cc: @SophieDeBenedetto @wogri
The text was updated successfully, but these errors were encountered: