Skip to content

Refactor check against Coursier version-ordering onto Version.Update#3789

Draft
rtyley wants to merge 2 commits intoreplace-update-ForArtifactId-NewerVersions-with-ArtifactUpdateCandidatesfrom
refactor-coursier-ordering-check-onto-Version.Update
Draft

Refactor check against Coursier version-ordering onto Version.Update#3789
rtyley wants to merge 2 commits intoreplace-update-ForArtifactId-NewerVersions-with-ArtifactUpdateCandidatesfrom
refactor-coursier-ordering-check-onto-Version.Update

Conversation

@rtyley
Copy link
Contributor

@rtyley rtyley commented Jan 17, 2026

This change just refactors the logic of the check to live on Version.Update (introduced with 13380eb in PR #3145 in August 2023), which feels like a good place for it to belong.

The check for whether our version-updates comply with Coursier version-ordering was added with this PR in January 2020:

...the check was supposed to be temporary, until Scala Steward's own Order[Version] was considered battle-tested, but I don't know when we'll decide that's happened!

Notes

current == next is ok?

Since commit 75c08e6, committed directly to main a day later, VersionOrderingConflict has only been raised if current > next - so current == next is fine. There's no further info on why in the commit tho'!

New coursier-versions library

Our Scala Steward check uses coursier.core.Version, which is deprecated since Coursier 2.1.25.

The recommended class is now coursier.version.Version, which is in the newer https://github.com/coursier/versions library created in May 2020.

# Conflicts:
#	modules/core/src/main/scala/org/scalasteward/core/update/FilterAlg.scala
This change just refactors the logic of the check to live on `Version.Update`
(introduced with 13380eb in PR #3145 in August 2023), which feels like a
good place for it to belong.

The check for whether our version-updates comply with Coursier
version-ordering was added with this PR in January 2020:

* #1210

...the check was supposed to be temporary, until Scala Steward's
own `Order[Version]` was considered battle-tested, but I don't know
when we'll decide that's happened!

## `current == next` is ok?

Since commit 75c08e6, committed directly to `main` a day later,
`VersionOrderingConflict` has only been raised if `current > next` - so
`current == next` is fine. There's no further info on _why_ in the commit
tho'!

75c08e6

## New `coursier-versions` library

Our Scala Steward check uses `coursier.core.Version`, which is deprecated since
Coursier 2.1.25:

https://github.com/coursier/coursier/blame/0f3ceb65e9e46826967d2e4cb6f87cf7fb3e5c9d/modules/core/shared/src/main/scala/coursier/core/Version.scala#L14

...the recommended class is now `coursier.version.Version`, which is in the newer
https://github.com/coursier/versions library created in May 2020:

https://github.com/coursier/versions/blob/main/versions/shared/src/coursier/version/Version.scala
@codecov
Copy link

codecov bot commented Jan 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.85%. Comparing base (50cf04b) to head (f02d697).

Additional details and impacted files
@@                                             Coverage Diff                                              @@
##           replace-update-ForArtifactId-NewerVersions-with-ArtifactUpdateCandidates    #3789      +/-   ##
============================================================================================================
- Coverage                                                                     89.86%   89.85%   -0.02%     
============================================================================================================
  Files                                                                           174      174              
  Lines                                                                          5064     5059       -5     
  Branches                                                                        454      464      +10     
============================================================================================================
- Hits                                                                           4551     4546       -5     
  Misses                                                                          513      513              

☔ 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 changed the title Refactor check of Coursier ordering onto Version.Update Refactor check against Coursier version-ordering onto Version.Update Jan 17, 2026
@rtyley rtyley force-pushed the replace-update-ForArtifactId-NewerVersions-with-ArtifactUpdateCandidates branch 12 times, most recently from 28c68e6 to df28ac4 Compare January 18, 2026 09:37
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.

1 participant