-
Notifications
You must be signed in to change notification settings - Fork 477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
util/s3: improve patch number capacity in version comparison #5224
util/s3: improve patch number capacity in version comparison #5224
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
cmd/updater/version_test.go
Outdated
testValidVersion(t, "algonode_update_0.1.0.log", uint64(0x01000000)) | ||
testValidVersion(t, "algo_update_0.1.0", uint64(0x01000000)) | ||
testValidVersion(t, "algo_update_65535.1.0", uint64(0x00FFFF000001000000)) | ||
testValidVersion(t, "algo_update_65535.65535.65535", uint64(0x00FFFF00FFFF00FFFF)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May as well add the test
testValidVersion(t, "algo_update_65535.65535.65535", uint64(0x00FFFF00FFFF00FFFF)) | |
testValidVersion(t, "algo_update_65535.65535.65535", uint64(0x00FFFF00FFFF00FFFF)) | |
testValidVersion(t, "algo_update_16777215.16777215.16777215", uint64(0xFFFFFFFFFFFFFFFFFF)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this number exceeds max uint64
maybe allocate 24bits for the patch and 16+16 for major/minor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
16/16/24 seems like a good option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (assuming these numbers are never written down)
Codecov Report
@@ Coverage Diff @@
## master #5224 +/- ##
==========================================
+ Coverage 52.94% 53.56% +0.62%
==========================================
Files 441 441
Lines 55098 55099 +1
==========================================
+ Hits 29171 29514 +343
+ Misses 23576 23298 -278
+ Partials 2351 2287 -64
... and 48 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Summary
Local builds could produce packages with higher than build number than the comparator in
updater
can handle.This affects both updater and nodecfg.
Test Plan
Added unit test