Add a list of BWC versions for CI (#44418)

This PR adds a list of index compatible versions to the `.ci` directory
as well as a way to generate and verify it.

Unfortunetly there is no easy way in Jenkins to have the build generate then
consume this YML axis config.
I hate that this would need maintenance on versions bumps, but the
potential benefir here is reducing the bwc builds that can take more than
24 hours to less than 20 minutes.
This is possible because the CI setup would use a matrix job to run
something like:
```
./graldew 'v7.0.0#bwcTest'
```
For every index compatible version.
On top of that `--parallel` should be possible even without testclusters
due to the limited number of clusters being set up here.

The example command above runs in exactly 10 minutes on my laptop,
thus I'm proposing to accept this compromise while we work out the
infra to do this more dinamically.
This commit is contained in:
Alpar Torok 2019-07-17 17:34:35 +03:00
parent 103ba976fd
commit 3a199d044c
2 changed files with 58 additions and 0 deletions

41
.ci/bwcVersions Normal file
View File

@ -0,0 +1,41 @@
BWC_VERSION:
- "6.0.0"
- "6.0.1"
- "6.1.0"
- "6.1.1"
- "6.1.2"
- "6.1.3"
- "6.1.4"
- "6.2.0"
- "6.2.1"
- "6.2.2"
- "6.2.3"
- "6.2.4"
- "6.3.0"
- "6.3.1"
- "6.3.2"
- "6.4.0"
- "6.4.1"
- "6.4.2"
- "6.4.3"
- "6.5.0"
- "6.5.1"
- "6.5.2"
- "6.5.3"
- "6.5.4"
- "6.6.0"
- "6.6.1"
- "6.6.2"
- "6.7.0"
- "6.7.1"
- "6.7.2"
- "6.8.0"
- "6.8.1"
- "6.8.2"
- "7.0.0"
- "7.0.1"
- "7.1.0"
- "7.1.1"
- "7.2.0"
- "7.2.1"
- "7.3.0"

View File

@ -106,6 +106,17 @@ subprojects {
* *something* to test against. */
BwcVersions versions = new BwcVersions(file('server/src/main/java/org/elasticsearch/Version.java').readLines('UTF-8'))
task updateCIBwcVersions() {
doLast {
File yml = file(".ci/bwcVersions")
yml.text = ""
yml << "BWC_VERSION:\n"
versions.indexCompatible.each {
yml << " - \"$it\"\n"
}
}
}
// build metadata from previous build, contains eg hashes for bwc builds
String buildMetadataValue = System.getenv('BUILD_METADATA')
if (buildMetadataValue == null) {
@ -149,6 +160,12 @@ task verifyVersions {
.collect { Version.fromString(it) }
)
}
String ciYml = file(".ci/bwcVersions").text
bwcVersions.indexCompatible.each {
if (ciYml.contains("\"$it\"\n") == false) {
throw new Exception(".ci/bwcVersions is outdated, run `./gradlew updateCIBwcVersions` and check in the results");
}
}
}
}