Skip to content

Commit aacb4a4

Browse files
authored
Add pull request job to verify transport versions backported via main (#134568) (#134675)
1 parent 026b73b commit aacb4a4

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
config:
2+
skip-target-branches: "main"
3+
steps:
4+
- label: validate-transport-version-backport
5+
command: .buildkite/scripts/validate-transport-version-backport.sh
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
echo "--- Looking for transport version changes"
5+
6+
# Get any changes in this pull request to transport definitions
7+
git fetch origin "${BUILDKITE_PULL_REQUEST_BASE_BRANCH}" --quiet
8+
changed_files=$(git diff --name-only "origin/${BUILDKITE_PULL_REQUEST_BASE_BRANCH}" | grep -E "server/src/main/resources/transport/definitions/.*\.csv" || true)
9+
10+
if [[ -z "${changed_files}" ]]; then
11+
echo "No transport version changes detected."
12+
exit 0
13+
fi
14+
15+
# Compare those files against the main branch to ensure they are the same
16+
git fetch origin main --quiet
17+
while IFS= read -r file; do
18+
if ! git diff --quiet origin/main -- "${file}"; then
19+
echo "Changes to transport definition [${file}] missing from main branch."
20+
echo "Transport changes must first be merged to main before being backported."
21+
exit 1
22+
fi
23+
done <<< "${changed_files}"
24+
25+
echo "All transport changes exist in main branch."

0 commit comments

Comments
 (0)