Skip to content

Commit ed40c91

Browse files
committed
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.
1 parent e158630 commit ed40c91

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.ci/bwcVersions

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
BWC_VERSION:
2+
- "6.0.0"
3+
- "6.0.1"
4+
- "6.1.0"
5+
- "6.1.1"
6+
- "6.1.2"
7+
- "6.1.3"
8+
- "6.1.4"
9+
- "6.2.0"
10+
- "6.2.1"
11+
- "6.2.2"
12+
- "6.2.3"
13+
- "6.2.4"
14+
- "6.3.0"
15+
- "6.3.1"
16+
- "6.3.2"
17+
- "6.4.0"
18+
- "6.4.1"
19+
- "6.4.2"
20+
- "6.4.3"
21+
- "6.5.0"
22+
- "6.5.1"
23+
- "6.5.2"
24+
- "6.5.3"
25+
- "6.5.4"
26+
- "6.6.0"
27+
- "6.6.1"
28+
- "6.6.2"
29+
- "6.7.0"
30+
- "6.7.1"
31+
- "6.7.2"
32+
- "6.8.0"
33+
- "6.8.1"
34+
- "6.8.2"
35+
- "7.0.0"
36+
- "7.0.1"
37+
- "7.1.0"
38+
- "7.1.1"
39+
- "7.2.0"

build.gradle

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,17 @@ subprojects {
109109
* *something* to test against. */
110110
BwcVersions versions = new BwcVersions(file('server/src/main/java/org/elasticsearch/Version.java').readLines('UTF-8'))
111111

112+
task updateCIBwcVersions() {
113+
doLast {
114+
File yml = file(".ci/bwcVersions")
115+
yml.text = ""
116+
yml << "BWC_VERSION:\n"
117+
versions.indexCompatible.each {
118+
yml << " - \"$it\"\n"
119+
}
120+
}
121+
}
122+
112123
// build metadata from previous build, contains eg hashes for bwc builds
113124
String buildMetadataValue = System.getenv('BUILD_METADATA')
114125
if (buildMetadataValue == null) {
@@ -152,6 +163,12 @@ task verifyVersions {
152163
.collect { Version.fromString(it) }
153164
)
154165
}
166+
String ciYml = file(".ci/bwcVersions").text
167+
bwcVersions.indexCompatible.each {
168+
if (ciYml.contains("\"$it\"\n") == false) {
169+
throw new Exception(".ci/bwcVersions is outdated, run `./gradlew updateCIBwcVersions` and check in the results");
170+
}
171+
}
155172
}
156173
}
157174

0 commit comments

Comments
 (0)