Skip to content

Commit

Permalink
[INTERNAL][API] Ignore micro/patch version for compatibility check
Browse files Browse the repository at this point in the history
Adjusts the version compatibility logic to only check for major and
minor versions and ignore micro/patch versions. This allows us to push
out bugfix releases without breaking compatibility without having to
first implement a more sophisticated version compatibility logic.
  • Loading branch information
tobous authored and m273d15 committed May 19, 2020
1 parent e02b061 commit 791042b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
4 changes: 0 additions & 4 deletions core/src/saros/versioning/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@ public int compareTo(Version other) {

result = minor - other.minor;

if (result != 0) return result;

result = micro - other.micro;

return result;
}

Expand Down
17 changes: 15 additions & 2 deletions core/test/junit/saros/versioning/VersionManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void testVersionsSameOnlyQualifierDiffers() {
@Test
public void testlocalVersionOlder() {
Version local = Version.parseVersion("1.1.1.r1");
Version remote = Version.parseVersion("1.1.2.r1");
Version remote = Version.parseVersion("1.2.1.r1");

init(local, remote);

Expand All @@ -118,7 +118,7 @@ public void testlocalVersionOlder() {

@Test
public void testlocalVersionNewer() {
Version local = Version.parseVersion("1.1.2.r1");
Version local = Version.parseVersion("1.2.1.r1");
Version remote = Version.parseVersion("1.1.1.r1");

init(local, remote);
Expand All @@ -128,4 +128,17 @@ public void testlocalVersionNewer() {

assertEquals(Compatibility.NEWER, result.getCompatibility());
}

@Test
public void testlocalVersionNewerMicro() {
Version local = Version.parseVersion("1.1.2.r1");
Version remote = Version.parseVersion("1.1.1.r1");

init(local, remote);

VersionCompatibilityResult result =
versionManagerLocal.determineVersionCompatibility(bobContact);

assertEquals(Compatibility.OK, result.getCompatibility());
}
}

0 comments on commit 791042b

Please sign in to comment.