Skip to content

Commit

Permalink
Map old release version id directly to their version, don't specify a…
Browse files Browse the repository at this point in the history
… range (elastic#105335)
  • Loading branch information
thecoop authored Feb 14, 2024
1 parent c0e931a commit a0c21f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions server/src/main/java/org/elasticsearch/ReleaseVersions.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,15 @@ private static IntFunction<String> lookupFunction(NavigableMap<Integer, List<Ver
// the next version is just a guess - might be a newer revision, might be a newer minor or major...
lowerBound = nextVersion(lastItem(lowerRange.getValue())).toString();
} else {
// a really old version we don't otherwise know about
// assume it's an old version id
// a really old version we don't have a record for
// assume it's an old version id - we can just return it directly
// this will no longer be the case with ES 10 (which won't know about ES v8.x where we introduced separated versions)
// maybe keep the release mapping around in the csv file?
// SEP for now
@UpdateForV9
// @UpdateForV10
Version oldVersion = Version.fromId(id);
lowerBound = oldVersion.toString();
return oldVersion.toString();
}

var upperRange = versions.higherEntry(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void testReturnsRange() {
IntFunction<String> versions = ReleaseVersions.generateVersionsLookup(ReleaseVersionsTests.class);

assertThat(versions.apply(17), equalTo("8.1.2-8.2.0"));
assertThat(versions.apply(9), equalTo("0.0.0-8.0.0"));
assertThat(versions.apply(9), equalTo("0.0.0"));
assertThat(versions.apply(24), equalTo("8.2.2-snapshot[24]"));
}
}

0 comments on commit a0c21f8

Please sign in to comment.