Skip to content

Commit cf3fbd1

Browse files
committed
Add FwC branch configuration and update periodic trigger logic
Ensuring that only relevant branches are considered.
1 parent aa17c79 commit cf3fbd1

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

.buildkite/scripts/fwc-branches.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# Configure FwC test branches
4+
# We do not want 7.x branch and only to run for branches that:
5+
# - have released at least one minor version (not main)
6+
# - have previous minor unreleased (not the oldest development branch)
7+
FWC_BRANCHES=()
8+
for branch in "${BRANCHES[@]}"; do
9+
if [[ ! "$branch" =~ ^7\..* ]]; then
10+
FWC_BRANCHES+=("$branch")
11+
fi
12+
done
13+
# Remove first and last element
14+
FWC_BRANCHES=("${FWC_BRANCHES[@]:1:${#FWC_BRANCHES[@]}-2}")
15+
16+
shouldRunFwcFor() {
17+
local branch=$1
18+
for fwc_branch in "${FWC_BRANCHES[@]}"; do
19+
if [[ "$fwc_branch" == "$branch" ]]; then
20+
return 0
21+
fi
22+
done
23+
return 1
24+
}

.buildkite/scripts/periodic.trigger.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -euo pipefail
55
echo "steps:"
66

77
source .buildkite/scripts/branches.sh
8+
source .buildkite/scripts/fwc-branches.sh
89

910
IS_FIRST=true
1011
SKIP_DELAY="${SKIP_DELAY:-false}"
@@ -46,8 +47,7 @@ EOF
4647
branch: "$BRANCH"
4748
commit: "$LAST_GOOD_COMMIT"
4849
EOF
49-
# Include forward compatibility tests only for the bugfix branch
50-
if [[ "${BRANCH}" == "${BRANCHES[2]}" ]]; then
50+
if shouldRunFwcFor "$BRANCH"; then
5151
cat <<EOF
5252
- trigger: elasticsearch-periodic-fwc
5353
label: Trigger periodic-fwc pipeline for $BRANCH

0 commit comments

Comments
 (0)