Skip to content

Commit f9641b8

Browse files
authored
Add reminder to add BWC codecs on major version upgrade (#86844)
Codifies the requirement to add Lucene BWC codecs and corresponding tests when upgrading Elasticsearch to the next major version. Relates #81210
1 parent d45b19d commit f9641b8

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
package org.elasticsearch.xpack.lucene.bwc.codecs;
9+
10+
import org.elasticsearch.Version;
11+
import org.elasticsearch.test.ESTestCase;
12+
13+
public class OldCodecsAvailableTests extends ESTestCase {
14+
15+
/**
16+
* Reminder to add Lucene BWC codecs under {@link org.elasticsearch.xpack.lucene.bwc.codecs} whenever Elasticsearch is upgraded
17+
* to the next major Lucene version.
18+
*/
19+
public void testLuceneBWCCodecsAvailable() {
20+
assertEquals("Add Lucene BWC codecs for Elasticsearch version 7", 8, Version.CURRENT.major);
21+
}
22+
23+
}

x-pack/qa/repository-old-versions/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) {
6262
transformSpec.getTo().attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.DIRECTORY_TYPE);
6363
});
6464

65+
int currentMajorVersion = org.elasticsearch.gradle.VersionProperties.elasticsearchVersion.major
66+
assert (currentMajorVersion - 2) == 6 : "add archive BWC tests for major version " + (currentMajorVersion - 2)
6567
for (String versionString : ['5.0.0', '5.6.16', '6.0.0', '6.8.20']) {
6668
Version version = Version.fromString(versionString)
6769
String packageName = 'org.elasticsearch.distribution.zip'

0 commit comments

Comments
 (0)