Skip to content

Commit

Permalink
retain version utils version 1 check
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Walter Knize <[email protected]>
  • Loading branch information
nknize committed Nov 1, 2022
1 parent 9fa3ff4 commit 6f15d24
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/framework/src/main/java/org/opensearch/test/VersionUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,29 @@ static Tuple<List<Version>, List<Version>> resolveReleasedVersions(Version curre
stableVersions = currentMajor;
}

// remove last minor unless it's the first OpenSearch version.
// all Legacy ES versions are released, so we don't exclude any.
if (current.equals(Version.fromId(1000099 ^ Version.MASK)) == false) {
List<Version> lastMinorLine = stableVersions.get(stableVersions.size() - 1);
if (lastMinorLine.get(lastMinorLine.size() - 1) instanceof LegacyESVersion == false) {
// if the last minor line is Legacy there are no more staged releases; do nothing
// otherwise the last minor line is (by definition) staged and unreleased
Version lastMinor = moveLastToUnreleased(stableVersions, unreleasedVersions);
// no more staged legacy bugfixes so skip;
if (lastMinor instanceof LegacyESVersion == false && lastMinor.revision == 0) {
// this is not a legacy version; remove the staged bugfix
if (stableVersions.get(stableVersions.size() - 1).size() == 1) {
// a minor is being staged, which is also unreleased
moveLastToUnreleased(stableVersions, unreleasedVersions);
}
// remove the next bugfix
if (stableVersions.isEmpty() == false) {
moveLastToUnreleased(stableVersions, unreleasedVersions);
}
}
}
}

// If none of the previous major was released, then the last minor and bugfix of the old version was not released either.
if (previousMajor.isEmpty()) {
assert currentMajor.isEmpty() : currentMajor;
Expand Down

0 comments on commit 6f15d24

Please sign in to comment.