Add CI matrix configuration for snapshot BWC versions (#83990)

This commit is contained in:
Mark Vieira 2022-02-15 14:40:21 -08:00 committed by GitHub
parent c33da22a77
commit 2aab7cc868
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 12 deletions

5
.ci/snapshotBwcVersions Normal file
View File

@ -0,0 +1,5 @@
BWC_VERSION:
- "7.17.1"
- "8.0.1"
- "8.1.0"
- "8.2.0"

View File

@ -68,17 +68,28 @@ ext.testArtifact = { p, String name = "test" ->
}
tasks.register("updateCIBwcVersions") {
doLast {
File yml = file(".ci/bwcVersions")
yml.text = ""
yml << "BWC_VERSION:\n"
BuildParams.bwcVersions.indexCompatible.each {
yml << " - \"$it\"\n"
def writeVersions = { File file, List<Version> versions ->
file.text = ""
file << "BWC_VERSION:\n"
versions.each {
file << " - \"$it\"\n"
}
}
doLast {
writeVersions(file(".ci/bwcVersions"), BuildParams.bwcVersions.indexCompatible)
writeVersions(file(".ci/snapshotBwcVersions"), BuildParams.bwcVersions.unreleasedIndexCompatible)
}
}
tasks.register("verifyVersions") {
def verifyCiYaml = { File file, List<Version> versions ->
String ciYml = file.text
versions.each {
if (ciYml.contains("\"$it\"\n") == false) {
throw new Exception("${file} is outdated, run `./gradlew updateCIBwcVersions` and check in the results")
}
}
}
doLast {
if (gradle.startParameter.isOffline()) {
throw new GradleException("Must run in online mode to verify versions")
@ -94,12 +105,8 @@ tasks.register("verifyVersions") {
.collect { Version.fromString(it) }
)
}
String ciYml = file(".ci/bwcVersions").text
BuildParams.bwcVersions.indexCompatible.each {
if (ciYml.contains("\"$it\"\n") == false) {
throw new Exception(".ci/bwcVersions is outdated, run `./gradlew updateCIBwcVersions` and check in the results");
}
}
verifyCiYaml(file(".ci/bwcVersions"), BuildParams.bwcVersions.indexCompatible)
verifyCiYaml(file(".ci/snapshotBwcVersions"), BuildParams.bwcVersions.unreleasedIndexCompatible)
// Make sure backport bot config file is up to date
JsonNode backportConfig = new ObjectMapper().readTree(file(".backportrc.json"))