Preserve per-source cooldown when converging sources from the lockfile#9601
Merged
Merged
Conversation
Member
|
Thanks for the clear repro. I confirmed your issue locally. The new specs fail on master and pass with the fix. Your diagnosis is correctly. |
Member
|
I will release 4.0.14 with this in this week. |
This was referenced Jun 8, 2026
This was referenced Jun 14, 2026
Merged
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?
While rolling out cooldown on our apps I noticed that a per-source cooldown declared in the Gemfile (
source "https://rubygems.org", cooldown: 7) stops having any effect once aGemfile.lockexists.bundle update, andbundle installafter adding a new gem to the Gemfile, both resolve to versions inside the cooldown window as if no cooldown was configured. The same value set throughbundle config set cooldown 7or--cooldown 7is honored in those scenarios.Repro:
The cause is in
SourceList#replace_rubygems_source. When the Gemfile sources are converged with the lockfile sources, the locked source object replaces the Gemfile one and onlyremotesis copied across. The@remote_cooldownshash stays behind on the discarded Gemfile source, socooldown_forreturns nil for every remote and the fetchers are built without a cooldown.What is your fix for the problem, implemented in this PR?
Carry the cooldowns over together with the remotes they apply to when a rubygems source is replaced by its locked equivalent.
Added two specs that fail on master:
bundle updatewith a lockfile present, and resolving a gem added to the Gemfile after the lockfile was written.Make sure the following tasks are checked