Skip to content

Added Cooldown regression tests#9602

Merged
hsbt merged 7 commits into
masterfrom
cooldown-regression-coverage
Jun 8, 2026
Merged

Added Cooldown regression tests#9602
hsbt merged 7 commits into
masterfrom
cooldown-regression-coverage

Conversation

@hsbt

@hsbt hsbt commented Jun 8, 2026

Copy link
Copy Markdown
Member

What was the end-user or developer problem that led to this PR?

Follow-up regression coverage for the per-source cooldown fix in #9601.

  • Pin that cooldown is silently inactive over the dependency API, which exposes no per-version publish dates for the filter to compare against.
  • Keep per-source cooldown attached to its own source across a partial update, for both a top-level source and a gem-block source.
  • Inherit the source's cooldown for a gem added via bundle add against an existing lockfile.
  • Hold a gem inside the cooldown window on bundle lock --update, asserted against the written lockfile (the exact path from the original report).
  • Pin that a frozen install reads the lockfile and ignores cooldown entirely.
  • Confirm cooldown is keyed by the URI declared in the Gemfile and still applies through a mirror redirect.

Make sure the following tasks are checked

hsbt and others added 7 commits June 8, 2026 16:53
The legacy dependency API exposes no per-version publish dates, so the
cooldown filter has nothing to compare against and silently does
nothing. Document that limitation as a regression guard rather than a
surprise.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A single converge can hold several rubygems sources, each keyed by its
own remotes. A partial update re-converges the still-locked sources, the
path that used to drop cooldown, so lock in that the cooldown stays
attached to the source that declared it for both a top-level source and
a gem-block source.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
bundle add re-resolves the Gemfile against the existing lockfile via the
injector, which converges sources the same way install and update do. A
gem added there must inherit the source's cooldown instead of grabbing
an in-window release.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This is the exact path from the original report: regenerating the
lockfile must not advance a gem into the cooldown window. Assert the
written lockfile to guard the lock-only flow that install and update
specs do not touch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A frozen install reads the lockfile rather than resolving, so cooldown
never runs. Document that a version locked inside the window still
installs, so the bypass stays intentional.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A mirror rewrites the fetch URI while cooldown stays keyed by the URI
declared in the Gemfile. Confirm the redirect to the serving mirror does
not lose the cooldown.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Stamping each solo_gem with its own Time.now.utc lets the two dates
drift apart and matches neither the surrounding before block. Snapshot
the time once so the cooldown window stays stable as thresholds tighten.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 8, 2026 09:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds regression specs to ensure Bundler’s per-source cooldown behavior remains correct across several workflows (partial updates, lockfile updates, bundle add, frozen installs, and mirrors), as a follow-up to the cooldown preservation fix from #9601.

Changes:

  • Add coverage ensuring per-source cooldown survives lockfile source convergence during partial updates (including multiple sources and gem-block sources).
  • Add coverage for cooldown behavior in bundle add, bundle lock --update, and frozen installs.
  • Add coverage asserting cooldown is keyed by the Gemfile-declared URI (including when a mirror redirect is configured) and documenting the dependency API limitation around publish dates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hsbt hsbt merged commit 252d8f6 into master Jun 8, 2026
109 checks passed
@hsbt hsbt deleted the cooldown-regression-coverage branch June 8, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants