[tool] Fix backport validator for non-SLURP

non-SLURP branches are EOL'd in case they reach their end of maintained
phase. This could produce a situation when a patch is merged in a
non-SLURP branch that was deleted in the meantime and it's further
backports fail on gate with backport validator as the hash of the
non-SLURP version of the patch is not on any branch.

This patch fixes the above issue as follows: in case a hash is not
found on any branch, then it checks if it can be found under any *-eol
tag and only fails if there is not found either.

Change-Id: I56705bce8ee4354cd5cb1577a520c2d1c525f57b
This commit is contained in:
Elod Illes
2025-05-13 15:06:27 +02:00
parent 023be4f561
commit e383b46545

View File

@ -26,8 +26,11 @@ branches+=""
for hash in $hashes; do
branch=$(git branch -a --contains "$hash" 2>/dev/null| grep -oE '(master|stable/[a-z0-9.]+|unmaintained/[a-z0-9.]+)')
if [ $? -ne 0 ]; then
echo "Cherry pick hash $hash not on any master, stable or unmaintained branches"
exit 1
branch=$(git tag --contains "$hash" 2>/dev/null| grep -oE '([0-9.]+-eol)')
if [ $? -ne 0 ]; then
echo "Cherry pick hash $hash not on any master, stable, unmaintained or EOL'd branches"
exit 1
fi
fi
branches+=" $branch"
checked=$(($checked + 1))