Refactor check against Coursier version-ordering onto Version.Update#3789
Draft
rtyley wants to merge 2 commits intoreplace-update-ForArtifactId-NewerVersions-with-ArtifactUpdateCandidatesfrom
Conversation
# 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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Version.UpdateVersion.Update
28c68e6 to
df28ac4
Compare
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.
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 == nextis ok?Since commit 75c08e6, committed directly to
maina day later,VersionOrderingConflicthas only been raised ifcurrent > next- socurrent == nextis fine. There's no further info on why in the commit tho'!New
coursier-versionslibraryOur 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.