-
Notifications
You must be signed in to change notification settings - Fork 178
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 pessimistic version constraint to instrumentation and overnight Canary Build #373
Comments
This changes provides instrumentation authors the ability to use gem specifications for version compatability checks instead of having to write a custom compatability block. In order to take advantage of this feature instrumentation authors must: 1. Declare the library and version constraints as a development dependency 2. Use instrumentation naming conventions e.g. `opentelemetry-instrumentation-ruby_kafka` Related https://github.com/open-telemetry/opentelemetry-ruby/issues/988
This changes provides instrumentation authors the ability to use gem specifications for version compatability checks instead of having to write a custom compatability block. In order to take advantage of this feature instrumentation authors must: 1. Declare the library and version constraints as a development dependency 2. Use instrumentation naming conventions e.g. `opentelemetry-instrumentation-ruby_kafka` Related https://github.com/open-telemetry/opentelemetry-ruby/issues/988
This changes provides instrumentation authors the ability to use gem specifications for version compatability checks instead of having to write a custom compatability block. In order to take advantage of this feature instrumentation authors must: 1. Declare the library and version constraints as a development dependency 2. Use instrumentation naming conventions e.g. `opentelemetry-instrumentation-ruby_kafka` Related https://github.com/open-telemetry/opentelemetry-ruby/issues/988
This changes provides instrumentation authors the ability to use gem specifications for version compatability checks instead of having to write a custom compatability block. In order to take advantage of this feature instrumentation authors must: 1. Declare the library and version constraints as a development dependency 2. Use instrumentation naming conventions e.g. `opentelemetry-instrumentation-ruby_kafka` Related https://github.com/open-telemetry/opentelemetry-ruby/issues/988
@robertlaurin Following up on our conversation from last week re: open-telemetry/opentelemetry-ruby#1025. Please correct me if I am misrepresenting your concerns and suggestions. Some of concerns you brought up were:
You had suggested the following:
You had mentioned that you would run through this when you had time and would update the existing instrumentations. 👍🏼 that is totally fine
Fine with me. I will put together a new PR that does that next week.
This one I think is still up in the air. I pointed out during out chat that this would not alleviate the issue with ensuring we have a known/tested version as well as supporting an open ended version constraints you want to achieve with the appraisal gem. I still find using RubyGems specifications to be the most idiomatic way to define compatibility constraints and compare the Requirement to the constant version of instrumented gem. I recommend considering creating an open-ended appraisal and generating a special gemspec with an open-ended dependency for testing against the latest version of a library. I would also recommend that we make this check optional and potentially a nightly build for most cases that way if the "latest" version fails we do not block folks from releasing working versions. We have a gemspec with the supported instrumented gems as a development dependency: Gem::Specification.new do |spec|
# lots of code...
spec.add_development_dependency 'trilogy', '>= 2.0', '< 3.0'
end We add an open-ended appraisal for latest # frozen_string_literal: true
# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0
appraise 'trilogy-2.0' do
gem 'trilogy', '~> 2.0'
end
appraise 'trilogy-latest' do
gem 'trilogy' # maybe a git repo for edge versions
end We either maintain multiple gemspecs, generate a new one removing constraints, or possibly add an environment variable that leaves off the constraints Gem::Specification.new do |spec|
# lots of code...
spec.add_development_dependency 'trilogy'
end Thoughts? |
* 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]>
👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the |
spawning off some discussion here open-telemetry/opentelemetry-ruby#947, there are two areas that ought to be addressed in instrumentation
Currently our instrumentation has the concept of a
compatible
block, which is just an arbitrary proc an instrumentation author can use to define logic for whether the instrumentation is compatible with the specific Gem version that has been installed. It could also be used to check arbitrary things like, for example, whether it's a jruby environment, or whether specific permissions are available, etc.In practice, afaik, this is only used to do a MIN_VERSION comparison, like in
action_pack
, for example.Over time, as new major versions come out, it becomes harder for us to say with confidence that our instrumentation is "compatible" with them, and so it might be worthwhile to make a pass through the instrumentation and add a
MAX_VERSION
comparison as well. In between the outcomes of "This instrumentation unexpectedly doesn't install and logs a warning to the user" and "This instrumentation causes an application crash during runtime", the former seems like a more reasonable posture for us to take.With that posture we would also need to have some sort of mechanism for reliably testing latest major version releases. One solution here could be to include a
latest
orcanary
nightly build in CI, that pulls in the latest major+minor versions of everything , runs the test suite, and informs us of what fails. In this way we could establish some confidence when we want to bump the MAX_VERSION compatibility, or have some context to point to if contributors/users open issues asking for a major version bump.lastly, as @arielvalentin suggests in this issue comment, open-telemetry/opentelemetry-ruby#947 (comment) , a DSL for declaring min/max version may make it easier to maintain this approach long term. Perhaps some semantic conventions around what constants to use for
MIN_VERSION
andMAX_VERSION
combined with a modification to thebase
compatible()
method could accomplish this (and also make it easier for a canary build to inform us when thelatest
gem version pulled down has a delta with the instrumentation'sMAX
version).The text was updated successfully, but these errors were encountered: