Browse Source

Remove temporary workaround for handling multiple staged releases (#56717)

Mark Vieira 5 years ago
parent
commit
612200ede1

+ 1 - 0
.ci/bwcVersions

@@ -17,6 +17,7 @@ BWC_VERSION:
   - "7.6.0"
   - "7.6.1"
   - "7.6.2"
+  - "7.7.0"
   - "7.7.1"
   - "7.8.0"
   - "7.9.0"

+ 1 - 1
build.gradle

@@ -113,7 +113,7 @@ task updateCIBwcVersions() {
     File yml = file(".ci/bwcVersions")
     yml.text = ""
     yml << "BWC_VERSION:\n"
-    versions.indexCompatible.each {
+    BuildParams.bwcVersions.indexCompatible.each {
       yml << "  - \"$it\"\n"
     }
   }

+ 1 - 14
buildSrc/src/minimumRuntime/java/org/elasticsearch/gradle/BwcVersions.java

@@ -19,14 +19,12 @@
 package org.elasticsearch.gradle;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.NoSuchElementException;
 import java.util.Set;
 import java.util.SortedSet;
 import java.util.TreeSet;
@@ -89,7 +87,6 @@ public class BwcVersions {
     private static final Pattern LINE_PATTERN = Pattern.compile(
         "\\W+public static final Version V_(\\d+)_(\\d+)_(\\d+)(_alpha\\d+|_beta\\d+|_rc\\d+)? .*"
     );
-    private static final List<Version> IGNORED_VERSIONS = Arrays.asList(Version.fromString("7.7.0"));
 
     private final Version currentVersion;
     private final Map<Integer, List<Version>> groupByMajor;
@@ -123,7 +120,6 @@ public class BwcVersions {
                         Integer.parseInt(match.group(3))
                     )
                 )
-                .filter(v -> !IGNORED_VERSIONS.contains(v)) // remove any specifically ignored versions
                 .collect(Collectors.toCollection(TreeSet::new)),
             currentVersionProperty
         );
@@ -276,16 +272,7 @@ public class BwcVersions {
                 // we found that the previous minor is staged but not yet released
                 // in this case, the minor before that has a bugfix, should there be such a minor
                 if (greatestMinor >= 2) {
-                    int major = groupByMinor.values()
-                        .stream()
-                        .flatMap(Collection::stream)
-                        .findFirst()
-                        .map(Version::getMajor)
-                        .orElseThrow(NoSuchElementException::new);
-                    // Don't bother searching for a version we've ignored
-                    if (IGNORED_VERSIONS.contains(new Version(major, greatestMinor - 2, 0)) == false) {
-                        unreleased.add(getLatestVersionByKey(groupByMinor, greatestMinor - 2));
-                    }
+                    unreleased.add(getLatestVersionByKey(groupByMinor, greatestMinor - 2));
                 }
             }
         }