ci: Apply a Bundler cooldown to dependency resolution - #35
Merged
Conversation
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
|
@cursor review |
…7 days Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
kinyoklion
marked this pull request as ready for review
August 27, 2026 16:16
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6f0f1fb. Configure here.
3 tasks
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
keelerm84
approved these changes
Aug 27, 2026
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.

Resolve dependencies only to gem versions that have been public for at least seven days, using Bundler's cooldown.
launchdarkly-server-sdkis exempt, so a constraint bump right after our own release still resolvessetup-rubystepRequirements
Related issues
Follow-up to #34: the RuboCop 1.90.0 breakage that PR works around would have been held out of CI by this cooldown.
Implementation details
How it works
source "https://rubygems.org", cooldown: 7makes Bundler consult the per-versioncreated_attimestamp in rubygems.org's v2 compact index during resolution and pass over any version younger than the window. Versions whose source does not exposecreated_at(private registries, pre-v2 entries) stay resolvable, so this never silently blocks a resolution.--cooldown 0/BUNDLE_COOLDOWN=0is the escape hatch when the newest release is exactly the one you want, e.g. a security fix.Why the second source block
Cooldown is stored per remote URI (
Bundler::Source::Rubygems#remote_cooldowns), with no per-gem option, and a secondsourceblock for the same URI does not get its own value. Naming the registry's index host gives a distinct remote that can carrycooldown: 0:Without this,
cooldown: 7fails resolution outright today: our gemspec requireslaunchdarkly-server-sdk ~> 8.15, 8.15.0 was published 2026-08-20, and no older version satisfies the constraint, so every candidate is inside the window.Exempting it is also the right policy: we publish that gem, so it is not the untrusted-third-party case cooldown defends against.
Verification
Ran locally in containers against this branch (no lockfile, Bundler 4.0.19):
rubocop 1.90.0 (available in 6 days), resolved 1.89.0 instead;launchdarkly-server-sdk 8.15.0resolved; 73 examples 0 failures; 15 files inspected, no offenses-javaplatform gem through the exempt remoteAlso confirmed Bundler 2.6.9 (Ruby 3.4's default) resolves the same Gemfile without error, ignoring the
cooldown:option.Alternatives considered
cooldown: 3with no exemption: shorter window, and still breaks for three days after each of our own SDK releases.Gemfile.lockand let Dependabot bump it with a cooldown: gives an auditable dependency history, but pins a library to specific versions and stops testing against the newest supported ones.bundle config set cooldown/BUNDLE_COOLDOWNin the CI workflow only: leaves localbundle installunprotected, and cannot express a per-source exemption.bundle-safe-updategem (pre-dates Bundler's feature): a low-adoption single-maintainer dependency, which is itself supply-chain risk.Link to Devin session: https://app.devin.ai/sessions/47847578334a4bd497c24e3859630cd2
Requested by: @kinyoklion
Note
Overview
CI and local installs now resolve gems from rubygems.org only if the version has been published for at least seven days, using Bundler’s
cooldownon the mainGemfilesource—without adding a lockfile or pinning versions beyond existing constraints.launchdarkly-server-sdkis pulled through a second source (index.rubygems.orgwithcooldown: 0) so first-party releases still resolve immediately; the PR description notes this is required because the current~> 8.15constraint would otherwise fail resolution.GitHub Actions pins Bundler 4.0.19 on
ruby/setup-rubyin the shared CI composite action and the Windows workflow so cooldown is honored in CI. CONTRIBUTING.md documents the behavior, the Bundler 4.0.13+ requirement, and--cooldown 0for urgent updates.Reviewed by Cursor Bugbot for commit a2cca54. Bugbot is set up for automated code reviews on this repo. Configure here.