Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8b74368
Create get-bc-commit.sh
ldematte May 29, 2025
049ec16
exit without pipeline upload for empty/failure; consider snapshots too
ldematte May 30, 2025
ea607b9
Merge branch 'main' into bc-upgrade/bc-commit-hash-script
ldematte May 30, 2025
1cc969a
add log
ldematte May 30, 2025
86d45b4
Merge branch 'bc-upgrade/bc-commit-hash-script' of github.com:ldematt…
ldematte May 30, 2025
0670191
Merge remote-tracking branch 'upstream/main' into bc-upgrade/bc-commi…
ldematte May 30, 2025
5a3e18a
extract version from manifest
ldematte May 30, 2025
ecab2e8
pr feedback
mosche Jun 2, 2025
b913f7a
fix whitespaces
mosche Jun 2, 2025
d02f5a2
Merge branch 'main' into bc-upgrade/bc-commit-hash-script
elasticmachine Jun 3, 2025
becfaf2
integrate script into build step, various minor fixes
mosche Jun 3, 2025
a2e0235
revert hardcoded branch filter for testing on branch
mosche Jun 3, 2025
7086a6f
Update .buildkite/scripts/run-bc-upgrade-tests.sh
ldematte Jun 9, 2025
c5a424b
Merge remote-tracking branch 'upstream/main' into bc-upgrade/bc-commi…
ldematte Jun 9, 2025
f7f2b07
PR comments
ldematte Jun 9, 2025
605e133
fix curl
ldematte Jun 17, 2025
50013e5
Merge remote-tracking branch 'upstream/main' into bc-upgrade/bc-commi…
ldematte Jun 17, 2025
5d12c6d
Merge branch 'main' into bc-upgrade/bc-commit-hash-script
ldematte Jun 17, 2025
0f6a063
Merge remote-tracking branch 'upstream/main' into bc-upgrade/bc-commi…
ldematte Jun 17, 2025
3beceea
Merge branch 'bc-upgrade/bc-commit-hash-script' of github.com:ldematt…
ldematte Jun 17, 2025
7736758
Extend CI intake pipeline to run BC upgrade tests (#128614)
ldematte Jun 17, 2025
afe5b64
comment
ldematte Jun 17, 2025
b9fb3fd
Merge branch 'main' into bc-upgrade/bc-commit-hash-script
ldematte Jun 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .buildkite/pipelines/intake.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ steps:
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: "{{matrix.BWC_VERSION}}"
- label: bc-upgrade
command: ".buildkite/scripts/run-bc-upgrade-tests.sh"
- group: lucene-compat
steps:
- label: "{{matrix.LUCENE_VERSION}} / lucene-compat"
Expand Down
5 changes: 5 additions & 0 deletions .buildkite/pipelines/intake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ steps:
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: "{{matrix.BWC_VERSION}}"
- label: bc-upgrade
command: ".buildkite/scripts/run-bc-upgrade-tests.sh"
agents:
image: "docker.elastic.co/ci-agent-images/eck-region/buildkite-agent:1.5"
memory: "4G"
- group: lucene-compat
steps:
- label: "{{matrix.LUCENE_VERSION}} / lucene-compat"
Expand Down
75 changes: 75 additions & 0 deletions .buildkite/scripts/run-bc-upgrade-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bin/bash

#
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the "Elastic License
# 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
# Public License v 1"; you may not use this file except in compliance with, at
# your election, the "Elastic License 2.0", the "GNU Affero General Public
# License v3.0 only", or the "Server Side Public License, v 1".
#

set -euo pipefail

echo "Selecting the most recent build from branch [$BUILDKITE_BRANCH]."

# Select the most recent build from the current branch.
# We collect snapshots, order by date, then collect BCs, order by date, and concat them; then we select the last.
# So if we have one (or more) BC, we will always prefer to use that. Otherwise we will use the latest snapshot.
MANIFEST_URL="$(curl -s https://artifacts.elastic.co/releases/TfEVhiaBGqR64ie0g0r0uUwNAbEQMu1Z/future-releases/stack.json |
jq ".releases[] |
select(.branch == \"$BUILDKITE_BRANCH\") |
select(.active_release == true) |
((.snapshots | to_entries | sort_by(.value.completed_at)) +
(.build_candidates | to_entries | sort_by(.value.completed_at))) |
last | .value.manifest_url")"

if [[ -z "$MANIFEST_URL" ]]; then
echo "No snapshots or build candidates for branch [$BUILDKITE_BRANCH]."
echo "Skipping BC upgrade tests."
exit 0
fi

echo "Getting build manifest from [$MANIFEST_URL]"

# Note: we use eval to perform variable substitution for the curl arguments, and command substitution to
# set the output variable. Double quotes are not enough in this case.
MANIFEST="$(eval "curl -s $MANIFEST_URL")"
if [[ -z "$MANIFEST" ]]; then
echo "Cannot get the build manifest from [$MANIFEST_URL]"
exit 1
fi

CURRENT_VERSION=$(sed -n 's/^elasticsearch[[:space:]]*=[[:space:]]*\(.*\)/\1/p' build-tools-internal/version.properties)

BC_VERSION=$(echo "$MANIFEST" | jq -r .version)
BC_BUILD_ID=$(echo "$MANIFEST" | jq -r .build_id)
BC_COMMIT_HASH=$(echo "$MANIFEST" | jq -r .projects.elasticsearch.commit_hash)

if [ "$CURRENT_VERSION-SNAPSHOT" != "$BC_VERSION" ]; then
echo "Version [$BC_VERSION] of BC (or snapshot) does not match current version [$CURRENT_VERSION] of branch [$BUILDKITE_BRANCH]."
echo "Skipping BC upgrade tests."
exit 0
fi

echo "Running BC upgrade tests on $BUILDKITE_BRANCH [$BC_VERSION] using BC (or snapshot) build of commit [$BC_COMMIT_HASH] with build id [$BC_BUILD_ID]."

cat <<EOF | buildkite-agent pipeline upload
steps:
- label: bc-upgrade $BC_BUILD_ID -> $BUILDKITE_BRANCH
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true -Dorg.elasticsearch.build.cache.push=true -Dignore.tests.seed -Dscan.capture-file-fingerprints -Dtests.bwc.main.version=${BC_VERSION} -Dtests.bwc.refspec.main=${BC_COMMIT_HASH} bcUpgradeTest -Dtests.jvm.argline="-Des.serverless_transport=true"
timeout_in_minutes: 300
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
machineType: n1-standard-32
buildDirectory: /dev/shm/bk
preemptible: true
retry:
automatic:
- exit_status: "-1"
limit: 3
signal_reason: none
- signal_reason: agent_stop
limit: 3
EOF