Skip to content

Commit

Permalink
Add reminder to add BWC codecs on major version upgrade (#86844)
Browse files Browse the repository at this point in the history
Codifies the requirement to add Lucene BWC codecs and corresponding tests when upgrading Elasticsearch to the next major version.

Relates #81210
  • Loading branch information
ywelsch committed May 17, 2022
1 parent d45b19d commit f9641b8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
@@ -0,0 +1,23 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

package org.elasticsearch.xpack.lucene.bwc.codecs;

import org.elasticsearch.Version;
import org.elasticsearch.test.ESTestCase;

public class OldCodecsAvailableTests extends ESTestCase {

/**
* Reminder to add Lucene BWC codecs under {@link org.elasticsearch.xpack.lucene.bwc.codecs} whenever Elasticsearch is upgraded
* to the next major Lucene version.
*/
public void testLuceneBWCCodecsAvailable() {
assertEquals("Add Lucene BWC codecs for Elasticsearch version 7", 8, Version.CURRENT.major);
}

}
2 changes: 2 additions & 0 deletions x-pack/qa/repository-old-versions/build.gradle
Expand Up @@ -62,6 +62,8 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) {
transformSpec.getTo().attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.DIRECTORY_TYPE);
});

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

0 comments on commit f9641b8

Please sign in to comment.