Skip to content

Refactor: Replace Update.Single's withNextVersion() with supersedes()#3793

Merged
rtyley merged 1 commit intomainfrom
single-update-does-not-need-withNextVersion
Jan 20, 2026
Merged

Refactor: Replace Update.Single's withNextVersion() with supersedes()#3793
rtyley merged 1 commit intomainfrom
single-update-does-not-need-withNextVersion

Conversation

@rtyley
Copy link
Contributor

@rtyley rtyley commented Jan 20, 2026

The needs of the Scala Steward codebase don't require a withNextVersion() method on Update.Single - just a supersedes() method supports the sole use, with PullRequestRepository.getObsoleteOpenPullRequests() needing to know if one Update can be replaced by another one.

The original withNewerVersions() method was added in response to this PR comment: #1667 (comment) ...but we reckon replacing it with a slightly different check makes for clearer, smaller, more explicit code.

This small refactor is extracted from #3762 (originally commit a11ee91), making that PR a little smaller!

Co-authored-by: @emdash-ie

…des()`

The needs of the Scala Steward codebase don't require a `withNextVersion()`
method on `Update.Single` - just a `supersedes()` method supports the sole
use, which is `PullRequestRepository.getObsoleteOpenPullRequests()` needing
to know if one `Update` can be replaced by another one.

The original `withNewerVersions()` method was 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.

This small refactor is extracted from #3762
(originally commit a11ee91), making that PR a little smaller!

Co-authored-by: Emily Bourke <emily.bourke@guardian.co.uk>
@rtyley rtyley force-pushed the single-update-does-not-need-withNextVersion branch from 6a33604 to 39325bd Compare January 20, 2026 11:57
@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.90%. Comparing base (63c5d11) to head (39325bd).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3793      +/-   ##
==========================================
+ Coverage   89.88%   89.90%   +0.01%     
==========================================
  Files         174      174              
  Lines        5063     5053      -10     
  Branches      447      441       -6     
==========================================
- Hits         4551     4543       -8     
+ Misses        512      510       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rtyley rtyley marked this pull request as ready for review January 20, 2026 12:03
@rtyley rtyley merged commit 1d740a0 into main Jan 20, 2026
18 checks passed
@mzuehlke mzuehlke added this to the 0.37.1 milestone Jan 23, 2026
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