Bundler compatibility checks #21648
Replies: 9 comments
-
Example of where they are both ranges: The other possibility is that the |
Beta Was this translation helpful? Give feedback.
-
Hmm... I feel like this might be overthinking it. Bundler doesn't resolve the Ruby version (it has no control over it). Therefore, there is no reason to be juggling two ranges by the time we are evaluating a specific dependency. It seems to me that you could reduce the ruby version to a specific version pretty quickly. Start with the highest version for which you have a built docker image, and iterate downwards until you find the first version that matches the project requirement. From there, use that concrete version in all other places. Maybe I am simplifying some necessary complexity away with these assumptions, but I think breaking the resolution into two passes will make this much simpler. |
Beta Was this translation helpful? Give feedback.
-
Bundler is aware of the chosen Ruby version(s) if you enter it into your When updating |
Beta Was this translation helpful? Give feedback.
-
Also, the reason for using the the double ranges is like this:
In theory someone on the project could use v4 and then the project won't run if you install the latest version of the dependency. |
Beta Was this translation helpful? Give feedback.
-
Yes, but Bundler doesn't elect the version, it just short-circuits if being run in an incompatible version. I think complicating this logic with intersecting ranges just for the rare event that you might upgrade to a version that is incompatible with a different Ruby version (but one which still satisfies the range in In that case, the required version of Ruby should be bumped OR you change the strategy to bundle within the minimum supported version of Ruby instead. How is this different than when you specify The exceptional cases can be just that: exceptional. |
Beta Was this translation helpful? Give feedback.
-
Keep in mind that I plan to have Renovate bumping the versions in Maybe the answer for now is to skip compatibility filtering at the datasource and allow all versions through, then wait if a "real" use case happens to someone and we have a concrete example to work off. Hopefully they find this issue :) |
Beta Was this translation helpful? Give feedback.
-
Yep, I expect that given this is how Renovate works with other package managers.
Yeah I understand this. The case I'm trying to make here is that deferring resolving the Ruby version to a concrete version makes the logic more complicated without really protecting from a common case here. Gems rarely define required versions of Ruby and where they do, they are generally doing so because they depend on syntax, semantics, or stdlib of a specific version or higher. If Renovate chooses the newest version it has available which satisfies the Ruby required range and using that concrete version for all resolution, you will catch all these cases. It's conceivable that you implicitly raise the actual required version from Ultimately, all the developers in the project will be using a concrete version. Either, they will specify a specific version in I think it is entirely acceptable to list as a caveat that if users of Renovate aren't specific about the Ruby version Renovate will (depending on what you choose), raise the implicit dependency on Ruby by upgrading gems or not suggest the latest versions due to being pessimistic about their version of Ruby. I'm curious what |
Beta Was this translation helpful? Give feedback.
-
@bjeanes btw, you should see a Machinist PR in your master issue now. It's not been raised yet because of scheduling but should hopefully generate lock file without error this time |
Beta Was this translation helpful? Give feedback.
-
Yep I see it! I'll respond with feedback/thoughts in #2983 (and I can move my comment to another issue if you prefer somewhere else) |
Beta Was this translation helpful? Give feedback.
-
I needed to hardcode bundler compatibility checks after discovering an unforeseen issue with @sleekybadger's compatibility check.
In short: a dependency may specify a Ruby range (e.g.
>= 2.3.0
) and a repository may also specify a range (e.g.~> 2.5.3
). We need to determine how to decide which cases are compatible and which not.The secondary problem is then how to calculate these. I'm thinking maybe we pull every Ruby version, then filter based on both ranges, and then check that the repository values are all contained within the dependency values.
@sleekybadger are you able to check how Bundler decides this?
Cc @bjeanes
Beta Was this translation helpful? Give feedback.
All reactions