Skip to content

Redux: Dependency Cooldowns, post #3787#3792

Closed
rtyley wants to merge 2 commits intomainfrom
add-dependency-cooldowns-redux-after-pr-3787
Closed

Redux: Dependency Cooldowns, post #3787#3792
rtyley wants to merge 2 commits intomainfrom
add-dependency-cooldowns-redux-after-pr-3787

Conversation

@rtyley
Copy link
Contributor

@rtyley rtyley commented Jan 18, 2026

This draft PR is a temporary redo of:

...rebased on top of:

...this draft PR is just a place for examining the alternative branch, to see if it should be folded back into #3762 .

@rtyley rtyley force-pushed the add-dependency-cooldowns-redux-after-pr-3787 branch 3 times, most recently from b5aa227 to 8ceff43 Compare January 20, 2026 11:53
@rtyley rtyley changed the base branch from replace-update-ForArtifactId-NewerVersions-with-ArtifactUpdateCandidates to single-update-does-not-need-withNextVersion January 20, 2026 11:53
@rtyley rtyley force-pushed the single-update-does-not-need-withNextVersion branch from 6a33604 to 39325bd Compare January 20, 2026 11:57
emdash-ie and others added 2 commits January 20, 2026 12:02
Add deserialisation test for VersionsCache Value

Add json fixture for new Value type

Add VersionWithFirstSeen

Add merging of new and old first-seen version data

Add deserialisation test for new format

It looks like we probably want to update UpdatesConfig.scala to add a
new method `isTooNew: Update.ForArtifactId => FilterResult` which rules
out proposed updates that use too new a version (according to the user’s
config).

To do that, we reckon we’ll need Update.ForArtifactId to list versions
with their firstSeen information, i.e. update the contained type from
Version to VersionWithFirstSeen. This commit begins making that
change (and so will not compile).

Replace withNewerVersions with supersedes

This commit removes withNewerVersions and replaces the one usage of it
with a new function supersedes, which checks whether an update matches
another while having a newer nextVersion.

withNewerVersions was a little awkward to update to work with us having
changed some Versions to VersionWithFirstSeens, because it accepts a
list of Versions (rather than just producing one).

It was originally added in response to [this PR
comment](#1667 (comment)),
but we reckon replacing it with a slightly different check of the
group and artifact IDs makes for clearer, more explicit code. We
think (though it’s somewhat hard to tell) that this doesn’t remove any
existing functionality: part of the argument for adding
withNewerVersions in the first place was to support Update.Group, but it
appears to only be called for Update.Singles.

Add CooldownConfig

To facilitate using dependency cooldowns, this commit adds a class
CooldownConfig to represent a user’s desired cooldown settings: a list
of ages (specified as finite durations, using the same string syntax as
supported for pullRequests.frequency), each with a list of
UpdatePatterns for the age to apply to.

Co-authored-by: Roberto Tyley <roberto.tyley@guardian.co.uk>

# Conflicts:
#	modules/core/src/main/scala/org/scalasteward/core/data/Update.scala
@rtyley rtyley force-pushed the add-dependency-cooldowns-redux-after-pr-3787 branch from 8ceff43 to 85d78db Compare January 20, 2026 12:02
@rtyley rtyley changed the base branch from single-update-does-not-need-withNextVersion to main January 20, 2026 13:47
@rtyley rtyley closed this Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants