feat: centralize semver-aware cooldown calculation#14600
Open
markhallen wants to merge 8 commits intomainfrom
Open
feat: centralize semver-aware cooldown calculation#14600markhallen wants to merge 8 commits intomainfrom
markhallen wants to merge 8 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Centralizes “release cooldown” behavior into a shared helper so multiple ecosystems apply semver-aware cooldown windows consistently, and ensures UV’s lockfile resolver forwards cooldown options into version resolution.
Changes:
- Introduces
Dependabot::UpdateCheckers::CooldownCalculationand refactors cooldown checks to use it. - Moves semver-based cooldown-day selection into
ReleaseCooldownOptions#cooldown_days_forand updates common version filtering to use the shared logic. - Propagates
update_cooldownthrough UV’s lockfile resolver intoLatestVersionFinder, and updates Bazel/Docker cooldown handling + specs.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
common/lib/dependabot/update_checkers/cooldown_calculation.rb |
Adds shared cooldown calculation helpers (window check, day selection, skip logic). |
common/spec/dependabot/update_checkers/cooldown_calculation_spec.rb |
Adds unit specs for the shared cooldown helper. |
common/lib/dependabot/package/release_cooldown_options.rb |
Adds semver-aware cooldown_days_for to centralize day selection logic. |
common/spec/dependabot/package/release_cooldown_options_spec.rb |
Adds coverage for semver-aware day selection behavior. |
common/lib/dependabot/package/package_latest_version_finder.rb |
Refactors cooldown filtering to use the shared helper and semver-aware day selection. |
docker/lib/dependabot/docker/update_checker.rb |
Updates Docker cooldown enforcement to be semver-aware per candidate tag. |
docker/spec/dependabot/docker/update_checker_spec.rb |
Adds spec coverage for semver-aware Docker cooldown behavior. |
bazel/lib/dependabot/bazel/update_checker.rb |
Updates Bazel cooldown enforcement to be semver-aware per candidate version. |
bazel/spec/dependabot/bazel/update_checker_spec.rb |
Updates Bazel specs to match the new cooldown method signature and behavior. |
uv/lib/dependabot/uv/update_checker/lock_file_resolver.rb |
Threads update_cooldown into LatestVersionFinder construction. |
uv/lib/dependabot/uv/update_checker.rb |
Passes @update_cooldown into the lock file resolver. |
uv/spec/dependabot/uv/update_checker/lock_file_resolver_spec.rb |
Adds coverage asserting cooldown options are forwarded into LatestVersionFinder. |
- Add DAY_IN_SECONDS constant to 7 ecosystem version finders that reference it without defining it - Remove unnecessary T.must wrappers in release_cooldown_options.rb where tuple destructuring already guarantees non-nil Integer values
uv/spec/dependabot/uv/update_checker/lock_file_resolver_spec.rb
Outdated
Show resolved
Hide resolved
…window? - Return false when cooldown_days <= 0 (no cooldown configured) - Return false when release_date is in the future (clock skew) - Add spec for future release date edge case - Fix misleading test description in uv lock_file_resolver_spec
The guard against negative time deltas (future release dates) was incorrect. A release with a future date (relative to Time.now) is strictly newer than any recently-released version and should remain within the cooldown window. The cooldown_days <= 0 guard remains correct and is kept.
1 task
…lation Replace inline cooldown arithmetic in 7 ecosystem files with CooldownCalculation.within_cooldown_window? from common. Each ecosystem retains its own logic for computing cooldown days (semver-aware, default-only, or custom) — only the time comparison is centralised.
robaiken
approved these changes
Apr 2, 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.
What are you trying to accomplish?
Resolves #14544
The
uvecosystem was not respecting release cooldown settings — PRs were opened for dependencies that were still within the configured cooldown window. The root cause was that the UV lockfile resolver was not forwardingupdate_cooldownoptions intoLatestVersionFinder, so cooldown filtering was never applied during resolution.This PR fixes that by passing cooldown options through the UV resolver code path, and also centralizes the duplicated cooldown calculation logic into a shared helper to prevent similar inconsistencies across ecosystems.
How the issue is resolved
update_cooldownintoLatestVersionFinderso cooldown filtering is applied during resolution.Additional improvements
Dependabot::UpdateCheckers::CooldownCalculationwithwithin_cooldown_window?,cooldown_days_for, andskip_cooldown?methods.ReleaseCooldownOptions#cooldown_days_forso ecosystems share one implementation.default_days.DAY_IN_SECONDSconstant to 7 ecosystem version finders that referenced it without defining it (Gradle, Go modules, GitHub Actions, pre-commit, devcontainers, Python, git submodules).T.mustwrappers inReleaseCooldownOptionswhere tuple destructuring already guarantees non-nil values.How will you know you've accomplished your goal?
common/spec/dependabot/update_checkers/cooldown_calculation_spec.rb).common/spec/dependabot/package/release_cooldown_options_spec.rb).LatestVersionFinder.Checklist