Refactor: Replace Update.Single's withNextVersion() with supersedes()#3793
Merged
Refactor: Replace Update.Single's withNextVersion() with supersedes()#3793
Update.Single's withNextVersion() with supersedes()#3793Conversation
…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>
6a33604 to
39325bd
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
mzuehlke
approved these changes
Jan 20, 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.
The needs of the Scala Steward codebase don't require a
withNextVersion()method onUpdate.Single- just asupersedes()method supports the sole use, withPullRequestRepository.getObsoleteOpenPullRequests()needing to know if oneUpdatecan 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