From 6e4f57120acbf7d93a76a7572b42cfe93ee3478c Mon Sep 17 00:00:00 2001 From: William Banfield Date: Thu, 8 Dec 2022 11:25:16 -0500 Subject: [PATCH] update the multiversion script to account for new dev- style --- test/e2e/generate-multiversion.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/test/e2e/generate-multiversion.sh b/test/e2e/generate-multiversion.sh index 48a8cf860..b17065c02 100755 --- a/test/e2e/generate-multiversion.sh +++ b/test/e2e/generate-multiversion.sh @@ -8,13 +8,23 @@ FLAGS=${ARGS:=-g 4 -d networks/nightly} # increasing semver version. SORTED_TAGS=`git tag -l --merge HEAD --sort="v:refname"` -# Extracts the major and minor version of the most recent -dev tagged version. +# Extracts the major and minor version of the most recent dev tagged version. +# Newer dev branches are tagged dev- whereas older dev branches are tagged +# -dev. This script first tries to find the highest version tagged with dev-. # For example, on the backport branch for v0.32, the most recent dev tag will contain v0.32.0-dev. -# v0.32 is then extracted from this tag. -BRANCH_MINOR_VERSION=`echo "$SORTED_TAGS" | grep '^v[0-9]\+\.[0-9]\+\.[0-9]\+\(-dev[0-9]*\)$' | tail -n 1 | sed -n 's/^\(v[0-9]\+\.[0-9]\+\).*/\1/p'` +# v0.32 is then extracted from this tag. On the branch for v0.38, which uses the newer +# tag style, the tag will contain dev-v0.38 + +# First check for the newer style tag. +BRANCH_MINOR_VERSION=`echo "$SORTED_TAGS" | grep '^dev-v[0-9]\+\.[0-9]\+\.[0-9]\+$' | tail -n 1 | sed -n 's/^dev-\(v[0-9]\+\.[0-9]\+\)\.[0-9]\+/\1/p'` + +# If we found no dev- tag, then try to find the highest -dev version instead. +if [ -z "$BRANCH_MINOR_VERSION" ]; then + BRANCH_MINOR_VERSION=`echo "$SORTED_TAGS" | grep '^v[0-9]\+\.[0-9]\+\.[0-9]\+\(-dev[0-9]\+\)$' | tail -n 1 | sed -n 's/^\(v[0-9]\+\.[0-9]\+\).*/\1/p'` +fi LATEST_RELEASE_VERSION=`echo "$SORTED_TAGS" | grep '^v[0-9]\+\.[0-9]\+\.[0-9]\+$' | tail -n 1` -# Check to see if the major and minor version of the latest release version are +# Check to see if the major and minor version of the latest released version are # the same as those of the current branch. This ensures that the multi-version testing # is only run on branches with a tagged release of the same major and minor version # and not on branches that do not yet have releases such as new backport branches