Skip to content

Commit f8adc64

Browse files
authored
[8.1] Add CI matrix configuration for snapshot BWC versions (#83990) (#83998)
* Add CI matrix configuration for snapshot BWC versions (#83990) * Remove incompatible version
1 parent 18c8c45 commit f8adc64

File tree

2 files changed

+23
-12
lines changed

2 files changed

+23
-12
lines changed

.ci/snapshotBwcVersions

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
BWC_VERSION:
2+
- "7.17.1"
3+
- "8.0.1"
4+
- "8.1.0"

build.gradle

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,28 @@ ext.testArtifact = { p, String name = "test" ->
6868
}
6969

7070
tasks.register("updateCIBwcVersions") {
71-
doLast {
72-
File yml = file(".ci/bwcVersions")
73-
yml.text = ""
74-
yml << "BWC_VERSION:\n"
75-
BuildParams.bwcVersions.indexCompatible.each {
76-
yml << " - \"$it\"\n"
71+
def writeVersions = { File file, List<Version> versions ->
72+
file.text = ""
73+
file << "BWC_VERSION:\n"
74+
versions.each {
75+
file << " - \"$it\"\n"
7776
}
7877
}
78+
doLast {
79+
writeVersions(file(".ci/bwcVersions"), BuildParams.bwcVersions.indexCompatible)
80+
writeVersions(file(".ci/snapshotBwcVersions"), BuildParams.bwcVersions.unreleasedIndexCompatible)
81+
}
7982
}
8083

8184
tasks.register("verifyVersions") {
85+
def verifyCiYaml = { File file, List<Version> versions ->
86+
String ciYml = file.text
87+
versions.each {
88+
if (ciYml.contains("\"$it\"\n") == false) {
89+
throw new Exception("${file} is outdated, run `./gradlew updateCIBwcVersions` and check in the results")
90+
}
91+
}
92+
}
8293
doLast {
8394
if (gradle.startParameter.isOffline()) {
8495
throw new GradleException("Must run in online mode to verify versions")
@@ -94,12 +105,8 @@ tasks.register("verifyVersions") {
94105
.collect { Version.fromString(it) }
95106
)
96107
}
97-
String ciYml = file(".ci/bwcVersions").text
98-
BuildParams.bwcVersions.indexCompatible.each {
99-
if (ciYml.contains("\"$it\"\n") == false) {
100-
throw new Exception(".ci/bwcVersions is outdated, run `./gradlew updateCIBwcVersions` and check in the results");
101-
}
102-
}
108+
verifyCiYaml(file(".ci/bwcVersions"), BuildParams.bwcVersions.indexCompatible)
109+
verifyCiYaml(file(".ci/snapshotBwcVersions"), BuildParams.bwcVersions.unreleasedIndexCompatible)
103110

104111
// Make sure backport bot config file is up to date
105112
JsonNode backportConfig = new ObjectMapper().readTree(file(".backportrc.json"))

0 commit comments

Comments
 (0)