Commit 79e9ff60 authored by Tomasz Zawadzki's avatar Tomasz Zawadzki Committed by Tomasz Zawadzki
Browse files

test/check_so_deps: use latest tag on branch if VERSION tag is missing



Fixes:
(2104eacf) test/check_so_deps: use VERSION to look for prior tags

Prior to patch above, the prior version tag was assumed to be latest
on the branch. It has been changed to lookup the prior tag by
VERSION file, which allowed us to create multiple tags (-rc*).

Yet it is now required for the tag matching VERSION to exist on repo.
This is not the case for patches that change VERSION, as they
cannot have a tag before being merged.
To handle this, if tag matching the VERSION does not exist,
fallback to prior behaviour.

Change-Id: Ib19e007a89794306866e827df7a628b26dcadfcb
Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@nutanix.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26075


Tested-by: default avatarSPDK Automated Test System <spdkbot@gmail.com>
Reviewed-by: default avatarMateusz Kozlowski <mateusz.kozlowski@solidigm.com>
Reviewed-by: default avatarKonrad Sztyber <ksztyber@nvidia.com>
parent 3702517b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -97,9 +97,13 @@ function get_release() {
		version="v$major.$minor"
		((patch > 0)) && version+=".$patch"
		version+=${suffix:+-$suffix}
		# When tag does not already exist, search for last tag on current branch
		if ! git show-ref --tags "$version" --quiet; then
			unset version
		fi
	fi

	tag=$(git describe --tags --abbrev=0 --exclude=LTS --exclude="*-pre" "$version")
	tag=$(git describe --tags --abbrev=0 --exclude=LTS --exclude="*-pre" $version)
	echo "${tag:0:6}"
}