Skip to content

Commit

Permalink
Add a list of BWC versions for CI (#44418)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alpar-t committed Jul 17, 2019
1 parent e158630 commit ed40c91
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .ci/bwcVersions
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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"
17 changes: 17 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,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) {
Expand Down Expand Up @@ -152,6 +163,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");
}
}
}
}

Expand Down

0 comments on commit ed40c91

Please sign in to comment.