Skip to content

Commit 6b1a6f7

Browse files
committed
Add forwards compatibility testing CI pipeline
1 parent 0d05ff9 commit 6b1a6f7

File tree

5 files changed

+58
-4
lines changed

5 files changed

+58
-4
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
steps:
2+
- label: $FWC_VERSION / fwc
3+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v$FWC_VERSION#fwcTest -Dtests.bwc.snapshot=false
4+
timeout_in_minutes: 300
5+
agents:
6+
provider: gcp
7+
image: family/elasticsearch-ubuntu-2004
8+
machineType: n1-standard-32
9+
buildDirectory: /dev/shm/bk
10+
preemptible: true
11+
matrix:
12+
setup:
13+
FWC_VERSION: $FWC_LIST
14+
env:
15+
FWC_VERSION: $FWC_VERSION

.buildkite/pipelines/periodic-fwc.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file is auto-generated. See .buildkite/pipelines/periodic-fwc.template.yml
2+
steps:
3+
- label: $FWC_VERSION / fwc
4+
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v$FWC_VERSION#fwcTest -Dtests.bwc.snapshot=false
5+
timeout_in_minutes: 300
6+
agents:
7+
provider: gcp
8+
image: family/elasticsearch-ubuntu-2004
9+
machineType: n1-standard-32
10+
buildDirectory: /dev/shm/bk
11+
preemptible: true
12+
matrix:
13+
setup:
14+
FWC_VERSION: []
15+
env:
16+
FWC_VERSION: $FWC_VERSION

.buildkite/scripts/branches.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22

33
# This determines which branches will have pipelines triggered periodically, for dra workflows.
44
BRANCHES=( $(cat branches.json | jq -r '.branches[].branch') )
5+
6+
# Sort them to make ordering predictable
7+
IFS=$'\n' BRANCHES=($(sort <<<"${BRANCHES[*]}"))
8+
unset IFS

.buildkite/scripts/periodic.trigger.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,15 @@ EOF
4646
branch: "$BRANCH"
4747
commit: "$LAST_GOOD_COMMIT"
4848
EOF
49+
# Include forward compatibility tests only for the bugfix branch
50+
if [[ "${BRANCH}" == "${BRANCHES[2]}" ]]; then
51+
cat <<EOF
52+
- trigger: elasticsearch-periodic-fwc
53+
label: Trigger periodic-fwc pipeline for $BRANCH
54+
async: true
55+
build:
56+
branch: "$BRANCH"
57+
commit: "$LAST_GOOD_COMMIT"
58+
EOF
59+
fi
4960
done

build.gradle

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import com.fasterxml.jackson.databind.JsonNode
1414
import com.fasterxml.jackson.databind.ObjectMapper
1515

1616
import org.elasticsearch.gradle.Version
17+
import org.elasticsearch.gradle.VersionProperties
1718
import org.elasticsearch.gradle.internal.BaseInternalPluginBuildPlugin
1819
import org.elasticsearch.gradle.internal.ResolveAllDependencies
1920
import org.elasticsearch.gradle.util.GradleUtils
@@ -118,10 +119,10 @@ tasks.register("updateCIBwcVersions") {
118119
outputFile.text = "# This file is auto-generated. See ${pipelineTemplatePath}\n" + pipeline
119120
}
120121

121-
// Writes a Buildkite pipelime from a template, and replaces $BWC_LIST with an array of versions
122+
// Writes a Buildkite pipelime from a template, and replaces a variable with an array of versions
122123
// Useful for writing a list of versions in a matrix configuration
123-
def expandBwcList = { String outputFilePath, String pipelineTemplatePath, List<Version> versions ->
124-
writeBuildkitePipeline(outputFilePath, pipelineTemplatePath, [new ListExpansion(versions: versions, variable: "BWC_LIST")])
124+
def expandList = { String outputFilePath, String pipelineTemplatePath, String variable, List<Version> versions ->
125+
writeBuildkitePipeline(outputFilePath, pipelineTemplatePath, [new ListExpansion(versions: versions, variable: variable)])
125126
}
126127

127128
// Writes a Buildkite pipeline from a template, and replaces $BWC_STEPS with a list of steps, one for each version
@@ -133,11 +134,18 @@ tasks.register("updateCIBwcVersions") {
133134
doLast {
134135
writeVersions(file(".ci/bwcVersions"), filterIntermediatePatches(buildParams.bwcVersions.allIndexCompatible))
135136
writeVersions(file(".ci/snapshotBwcVersions"), filterIntermediatePatches(buildParams.bwcVersions.unreleasedIndexCompatible))
136-
expandBwcList(
137+
expandList(
137138
".buildkite/pipelines/intake.yml",
138139
".buildkite/pipelines/intake.template.yml",
140+
"BWC_LIST",
139141
filterIntermediatePatches(buildParams.bwcVersions.unreleasedIndexCompatible)
140142
)
143+
expandList(
144+
".buildkite/pipelines/periodic-fwc.yml",
145+
".buildkite/pipelines/periodic-fwc.template.yml",
146+
"FWC_LIST",
147+
buildParams.bwcVersions.released.findAll { it.major == VersionProperties.elasticsearchVersion.major && it.minor == VersionProperties.elasticsearchVersion.minor }
148+
)
141149
writeBuildkitePipeline(
142150
".buildkite/pipelines/periodic.yml",
143151
".buildkite/pipelines/periodic.template.yml",

0 commit comments

Comments
 (0)