Skip to content

Commit 9bb56e5

Browse files
hsbtclaude
andcommitted
Cover cooldown downgrade through bundle lock --update
bundle update GEM already pins that an explicitly updated gem stays subject to cooldown and moves back to the newest aged version. Pin the same behavior through bundle lock --update, which shares the explicit-unlock machinery. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 1aeac73 commit 9bb56e5

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

spec/install/cooldown_spec.rb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,34 @@
684684
expect(lockfile).not_to include("ripe_gem (2.0.0)")
685685
end
686686

687+
it "still applies cooldown and downgrades a gem explicitly updated via bundle lock --update" do
688+
gemfile <<-G
689+
source "https://gem.repo3", cooldown: 7
690+
gem "ripe_gem"
691+
G
692+
693+
lockfile <<-L
694+
GEM
695+
remote: https://gem.repo3/
696+
specs:
697+
ripe_gem (2.0.0)
698+
699+
PLATFORMS
700+
#{lockfile_platforms}
701+
702+
DEPENDENCIES
703+
ripe_gem
704+
705+
BUNDLED WITH
706+
#{Bundler::VERSION}
707+
L
708+
709+
bundle "lock --update ripe_gem", artifice: "compact_index_cooldown"
710+
711+
expect(lockfile).to include("ripe_gem (1.0.0)")
712+
expect(lockfile).not_to include("ripe_gem (2.0.0)")
713+
end
714+
687715
it "ignores cooldown and installs the locked version when frozen" do
688716
# Frozen installs read the lockfile instead of resolving, so cooldown has
689717
# no say. A version already locked inside the window must still install.

0 commit comments

Comments
 (0)