28
28
29
29
/**
30
30
* A container for elasticsearch supported version information used in BWC testing.
31
- *
31
+ * <p>
32
32
* Parse the Java source file containing the versions declarations and use the known rules to figure out which are all
33
33
* the version the current one is wire and index compatible with.
34
34
* On top of this, figure out which of these are unreleased and provide the branch they can be built from.
35
- *
35
+ * <p>
36
36
* Note that in this context, currentVersion is the unreleased version this build operates on.
37
37
* At any point in time there will surely be four such unreleased versions being worked on,
38
38
* thus currentVersion will be one of these.
39
- *
39
+ * <p>
40
40
* Considering:
41
41
* <dl>
42
42
* <dt>M, M > 0</dt>
56
56
* <ul>
57
57
* <li>the unreleased <b>staged</b>, M.N-2.0 (N > 2) on the `M.(N-2)` branch</li>
58
58
* </ul>
59
- *
59
+ * <p>
60
60
* Each build is only concerned with versions before it, as those are the ones that need to be tested
61
61
* for backwards compatibility. We never look forward, and don't add forward facing version number to branches of previous
62
62
* version.
63
- *
63
+ * <p>
64
64
* Each branch has a current version, and expected compatible versions are parsed from the server code's Version` class.
65
65
* We can reliably figure out which the unreleased versions are due to the convention of always adding the next unreleased
66
66
* version number to server in all branches when a version is released.
@@ -162,8 +162,8 @@ private void assertCurrentVersionMatchesParsed(Version currentVersionProperty) {
162
162
}
163
163
164
164
/**
165
- * Returns info about the unreleased version, or {@code null} if the version is released.
166
- */
165
+ * Returns info about the unreleased version, or {@code null} if the version is released.
166
+ */
167
167
public UnreleasedVersionInfo unreleasedInfo (Version version ) {
168
168
return unreleased .get (version );
169
169
}
@@ -330,16 +330,17 @@ private List<Version> getReleased() {
330
330
331
331
public List <Version > getIndexCompatible () {
332
332
return unmodifiableList (
333
- Stream .concat (groupByMajor .get (currentVersion .getMajor () - 1 ).stream (), groupByMajor .get (currentVersion .getMajor ()).stream ())
334
- .filter (version -> version .equals (currentVersion ) == false )
335
- .collect (Collectors .toList ())
333
+ filterSupportedVersions (
334
+ Stream .concat (
335
+ groupByMajor .get (currentVersion .getMajor () - 1 ).stream (),
336
+ groupByMajor .get (currentVersion .getMajor ()).stream ()
337
+ ).filter (version -> version .equals (currentVersion ) == false ).collect (Collectors .toList ())
338
+ )
336
339
);
337
-
338
340
}
339
341
340
342
public List <Version > getWireCompatible () {
341
343
List <Version > wireCompat = new ArrayList <>();
342
-
343
344
List <Version > prevMajors = groupByMajor .get (currentVersion .getMajor () - 1 );
344
345
int minor = prevMajors .get (prevMajors .size () - 1 ).getMinor ();
345
346
for (int i = prevMajors .size () - 1 ; i > 0 && prevMajors .get (i ).getMinor () == minor ; i --) {
@@ -349,7 +350,13 @@ public List<Version> getWireCompatible() {
349
350
wireCompat .remove (currentVersion );
350
351
wireCompat .sort (Version ::compareTo );
351
352
352
- return unmodifiableList (wireCompat );
353
+ return unmodifiableList (filterSupportedVersions (wireCompat ));
354
+ }
355
+
356
+ private List <Version > filterSupportedVersions (List <Version > wireCompat ) {
357
+ return Architecture .current () == Architecture .AARCH64
358
+ ? wireCompat .stream ().filter (version -> version .onOrAfter ("7.12.0" )).collect (Collectors .toList ())
359
+ : wireCompat ;
353
360
}
354
361
355
362
public List <Version > getUnreleasedIndexCompatible () {
0 commit comments