Repository navigation
Compare version segments of any width so build-id updates stop vanishing - #5547
Open
Gabriel Dufresne (GabrielDuf) wants to merge 2 commits into
Open
Gabriel Dufresne (GabrielDuf) wants to merge 2 commits into
Gabriel Dufresne (GabrielDuf) wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Hashing versions with a large fifth segment still narrows to Int32 and throws an overflow exception.
1 open issue
What changed in this PR
Fixes missing Scoop build-ID updates by allowing arbitrarily large numeric version segments, addressing a comparison issue separate from #5434’s table-parsing fix.
Changes:
- Uses
BigIntegerfor version segments. - Preserves legacy overflow behavior for digit runs joined across non-separator characters.
- Adds comparison and update-detection regression tests.
| File | Description |
|---|---|
| src/UniGetUI.PackageEngine.Tests/PackageTests.cs | Tests update detection with large versions and build metadata. |
| src/UniGetUI.Core.Tools/Tools.cs | Widens version segments and refactors parsing. |
| src/UniGetUI.Core.Tools.Tests/ToolsTests.cs | Tests large segments, joined digits, and timestamp ordering. |
Review effort: Balanced
4 tasks done
There was a problem hiding this comment.
🤖 Pull request was approved automatically: the AI review is complete and all its review threads are resolved. 🎉
Integration Details
{
"deliveryId": "ffc01770-cbee-11f1-833f-29691ec5993a",
"headSha": "86a6abbe5a883a72def9af01e40a593faee52b49",
"reviewer": "copilot-pull-request-reviewer[bot]"
}This branch has not been deployed
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.

Follow-up to #5434 for the case reported after #5414 was reopened:
scoop status -llistslibrehardwaremonitor-dotnet10-nightly 37149234619 -> 38756550835, but UniGetUI shows no update.Root cause. Scoop nightly manifests use GitHub Actions run IDs as version numbers. Both versions are larger than
int.MaxValue, andCoreTools.VersionStringToStructparsed each segment withint.TryParse, which silently leaves 0 when the number overflows. So both versions became0.0.0.0, andPackageManager.CompareVersionsreturned 0.Package.NewerVersionIsInstalled()then concluded that a newer or equal version was already installed, andUpgradablePackagesLoaderdropped the update. The Scoop table parsing fixed in #5434 is not involved: the row parses correctly and is lost afterwards.Fix.
BigInteger, so unbroken digit runs compare correctly at any length.+, space,:,(). These keep the oldintlimit, including overflow to 0. Otherwise build metadata such as1.0.0+20260101123456would become a huge patch number that outranks1.0.1and hides that update.Known trade-off. A long digit-only version (timestamp or build ID) now ranks above any dotted version. If a vendor switches from
20250301123456to2.0.0, the new version reads as a downgrade. 8-digit dates already behaved this way. A test pins this behavior so that changing it has to be a deliberate decision.Verification.
librehardwaremonitor-dotnet10-nightly(38756550835) from theversionsbucket, andscoop status -lreported 39124059524 as available. The unfixed build loggedIgnoring package librehardwaremonitor-dotnet10-nightly because a newer or equal version than 39124059524 is already installed.; the fixed build kept the update.ToolsTestsandPackageTestscover ordering beyondintand beyond 19 digits, theNewerVersionIsInstalledpath for the reporter's versions, theintboundary for glued digit runs, and the timestamp trade-off.dotnet format whitespaceanddotnet format styleare clean.Closes #5414