Prevent version.isSnapshot from incorrectly identifying versions with hashes as snapshots#3659
Merged
rtyley merged 1 commit intoscala-steward-org:mainfrom Jul 6, 2025
Conversation
ef70026 to
d58d2fd
Compare
which incorrectly identifies versions with hashes as snapshots, for example: https://index.scala-lang.org/guardian/redirect-resolver/artifacts/redirect-resolver/0.0.38-PREVIEW.try-out-tool-versions-support.2024-04-26T1649.b33d9ccd
d58d2fd to
e930c3c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3659 +/- ##
==========================================
- Coverage 89.76% 89.75% -0.01%
==========================================
Files 174 174
Lines 5049 5048 -1
Branches 503 487 -16
==========================================
- Hits 4532 4531 -1
Misses 517 517 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
I couldn't find any evidence that version numbers with hashes in them should always be considered as snapshot releases - here's a counter-example, where a non-snapshot release of an ...so I think this PR is correct: |
version.isSnapshot from incorrectly identifying versions with hashes as snapshots
9 tasks
jonathonherbert
added a commit
to guardian/scala-steward-public-repos
that referenced
this pull request
Jul 9, 2025
jonathonherbert
added a commit
to guardian/scala-steward-public-repos
that referenced
this pull request
Jul 9, 2025
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.
What's changed?
At the moment, we're attempting to create a workflow to raise PRs against consuming projects when we publish prereleases.
In attempting to use
updates.allowPrereleasesto do that, we've encountered an issue where the commit hash in our prerelease version (e.g.0.0.37-PREVIEW.try-out-verify-artifact-hashes.2024-04-25T1652.c7fa7c2b) results in scala-steward misidentifying our release as a snapshot. As a result, it won't consider it as a valid next version.This PR corrects the behaviour of
version.isSnapshot, which was incorrectly identifying versions with hashes as snapshots.As far as we're aware, snapshotted versions are usually identified by a
-SNAPSHOTsuffix, which the case below already covers:scala-steward/modules/core/src/main/scala/org/scalasteward/core/data/Version.scala
Line 173 in ef70026