Fix accidental downgrades in Bundler PRs #6030
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dependabot monkeypatches Bundler to allow resolving for arbitrary rubies, not just for the running Ruby. However, when no Ruby information is provided via either
gemspec
files orruby
Gemfile directive, Dependabot was only allowing to resolve either to Ruby 2.5, or to the running Ruby 3.1.In some situations, it can happen that resolving on Ruby 3.1 is not possible, while resolving on Ruby 2.5 is possible but requires downgrading some lock file dependencies.
To avoid this problem, let's add the missing rubies to our list of rubies Dependabot can resolve to.
NOTE: I spent some time trying to write specs for this, but it turned out pretty tricky. In the end, I added a note in the Dockerfile to avoid falling out of sync again here. Also, I will look into porting this functionality to Bundler so that Dependabot does not need to monkey patch it, and thus leads to more consistent results.
Fixes #5926.