Don't exclude the locked version from cooldown during bundle update#9599
Merged
Conversation
…ndow bundle update and bundle outdated install a >= locked_version prevent-downgrade floor, so resolution never moves a gem backwards. The cooldown filter was excluding that same locked version, making resolution impossible whenever the lockfile was written before cooldown was enabled and still pins an in-cooldown release. Exempt the version sitting exactly at the floor; gems updated explicitly carry an exact = requirement and stay subject to cooldown. #9598 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes a Bundler resolver edge case where enabling a source cooldown could make bundle update/bundle outdated fail when the lockfile’s currently locked version falls within the cooldown window. The change ensures the “prevent-downgrade floor” version (>= locked_version) remains eligible for resolution, while still applying cooldown when a gem is explicitly updated.
Changes:
- Adjust Bundler’s cooldown filtering to not exclude the version that exactly matches the lockfile floor (
>= locked_version). - Add end-to-end specs covering
bundle update --all,bundle outdated, and explicitbundle update <gem>behavior under cooldown.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| spec/install/cooldown_spec.rb | Adds regression tests ensuring update/outdated don’t fail when the locked version is within cooldown, while explicit updates still respect cooldown. |
| bundler/lib/bundler/resolver.rb | Skips cooldown exclusion for specs matching the lockfile’s >= locked_version floor to prevent impossible resolution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The previous tests only exercised a top-level locked gem. Add a transitive dependency that resolves only through an in-cooldown version, and a case where a cooldown-eligible version above the locked one still gets picked up, so the full update behavior stays pinned down. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What was the end-user or developer problem that led to this PR?
Fixes #9598
What is your fix for the problem, implemented in this PR?
A lockfile written before cooldown was enabled often pins a version now inside the cooldown window.
bundle update/outdatedfloor each gem at>= locked_versionbut the cooldown filter then drops that same version, making resolution fail.Keep the version sitting at the floor eligible. gems updated explicitly carry an exact
=requirement and stay subject to cooldown.Make sure the following tasks are checked