]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
oeqa/utils/gitarchive: fix tag computation when creating archive
authorAlexis Lothoré <alexis.lothore@bootlin.com>
Fri, 18 Aug 2023 14:17:11 +0000 (16:17 +0200)
committerSteve Sakoman <steve@sakoman.com>
Sun, 12 Nov 2023 21:26:51 +0000 (11:26 -1000)
commitb0d96ea432196800fedb45e6d1da44a3523fad63
tree9480873ea22a9897ebdea27c791b7394084804bf
parent1506737eae894310bb98a82cf43c91f4b17d5878
oeqa/utils/gitarchive: fix tag computation when creating archive

Sporadic errors have been observed in autobuilder when trying to store new
tests results:

error: failed to push some refs to 'push.yoctoproject.org:yocto-testresults'
hint: Updates were rejected because the tag already exists in the remote.

The new tag name is generated by gitarchive based on known tags from the
repository (learnt with git tag). In autobuilder case, this repository is a
shallow clone, so git tag only returns most recent tags, which mean we
could miss some older tags which exist in remote but not locally. In this
case, gitarchive will likely create a tag which already exists in remote,
and so will fail to push

Fix this tag duplication by using git ls-remote to learn about existing
tags instead of git tag. To do so, create a helper ("get_tags") which
manages both nominal case (target directory is a git repository with a
proper remote) and fallback case (target directory is not from a clone, no
remote has been configured)

Fixes [YOCTO #15140]

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 9cbbe9689866158825a7ae774b7965b41ff5c461)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/lib/oeqa/utils/gitarchive.py