You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gh-631: compare major then minor in SemanticVersion.compareTo - #636
SemanticVersion.compareTo built an integer by concatenating major and minor
("%d%d"), so 1.32 became 132 and 2.0 became 20. Any 2.x server was therefore
treated as older than the 1.32 minimum and the client refused to connect.
This changes it to compare major first, then minor.
Tests: added cases to VersionSupportTest for 2.0.0, 2.5.1, 10.0.0, 1.100.0
and 1.31.9. Ran mvn test -Dtest=VersionSupportTest locally, all passing.
To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The compareTo declaration and body in VersionSupport.java remain indented two spaces too deeply relative to the annotation and surrounding record members.
Optional: no case checks a lower actual major with a larger minor, such as minimum 2.0.0 and actual 1.99.0. Add that case with false to cover the reverse direction of the concatenation bug.
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
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.
Fixes #631
SemanticVersion.compareTobuilt an integer by concatenating major and minor(
"%d%d"), so 1.32 became 132 and 2.0 became 20. Any 2.x server was thereforetreated as older than the 1.32 minimum and the client refused to connect.
This changes it to compare major first, then minor.
Tests: added cases to
VersionSupportTestfor 2.0.0, 2.5.1, 10.0.0, 1.100.0and 1.31.9. Ran
mvn test -Dtest=VersionSupportTestlocally, all passing.