Add test for old lockfile with new ruby version #6317
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.
Summary
We want to be able to
bundle install
onruby-head
starting from aGemfile.lock
that was generated on the latest stable release. This currently works, but has broken a few times over the past few years. This PR adds a test to prevent regressions to this workflow:I couldn't find existing test coverage of this exact scenario. I see a few tests that are close, but use
bundle update
orbundle lock
as the action, notbundle install
, so I wanted to add a more explicit test.Would the Bundler maintainers be willing to formally support this use case?
Note that this test has been passing since 45931ac / 4ff5419 (bundler 2.4.3).
(This PR is co-authored by @byroot.)
What was the end-user or developer problem that led to this PR?
For a couple years now, Shopify has been continuously testing our applications against ruby-head. This brings a lot of value to us as it allows to deal with breaking changes in advance, but more importantly we believe it brings a lot of value to the community. This practice allows us to report bugs quickly after they are introduced, which stabilizes the final release; it also gives us the opportunity to fix compatibility issues upstream in common gems way before the yearly Ruby release in December.
To achieve those goals, we need to test with the same gem versions, so regenerating the
Gemfile.lock
from scratch or runningbundle update
aren't quite the right solution.Over the last few years our testing pipelines have been broken a few times in surprising ways because of improvements and changes to how Bundler handle platforms. We'd like to add a test for this workflow to ensure that it continues working, if the Bundler team is open to supporting it.
Most recently, this workflow was broken in Bundler 2.4.1 (possibly earlier? I didn't bisect), we saw this error message after a bundler install on ruby-head:
This was quickly fixed in Bundler 2.4.3 (thank you for that!), but the test added doesn't explicitly cover this use case (unless I'm misunderstanding).
Make sure the following tasks are checked
Write code to solve the problemAlready passes!