[PATCH][autobuilder-helper][warrior 35/41] send-qa-email: Fix stable branch test result history issues


Richard Purdie
 

On stable release branch builds, it will clone "master" since comparebranch
is None. It will then fail to push since there is already a dunfell
branch upstream with changes on which it needs to rebase on top of.
The change to use shallow clones significantly increases this problem.

To fix this, fall back to cloning basebranch by name, then master
if it doesn't exist.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
scripts/send-qa-email | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/scripts/send-qa-email b/scripts/send-qa-email
index b4d4cec..abc17e2 100755
--- a/scripts/send-qa-email
+++ b/scripts/send-qa-email
@@ -55,8 +55,8 @@ if 'poky' in repos and os.path.exists(resulttool) and args.results_dir:
if comparebranch:
extraopts = extraopts + " --branch2 %s" % (comparebranch)
elif basebranch:
- print("No comparision branch found, comparing to master")
- extraopts = extraopts + " --branch2 master"
+ print("No comparision branch found, comparing to %s" % basebranch)
+ extraopts = extraopts + " --branch2 %s" % basebranch

report = subprocess.check_output([resulttool, "report", args.results_dir])
with open(args.results_dir + "/testresult-report.txt", "wb") as f:
@@ -64,7 +64,16 @@ if 'poky' in repos and os.path.exists(resulttool) and args.results_dir:

tempdir = tempfile.mkdtemp(prefix='sendqaemail.')
try:
- subprocess.check_call(["git", "clone", "git@git.yoctoproject.org:yocto-testresults", tempdir, "--depth", "5"])
+ cloneopts = []
+ if comparebranch:
+ cloneopts = ["--branch", comparebranch]
+ elif basebranch:
+ cloneopts = ["--branch", basebranch]
+ try:
+ subprocess.check_call(["git", "clone", "git@git.yoctoproject.org:yocto-testresults", tempdir, "--depth", "5"] + cloneopts)
+ except subprocess.CalledProcessError:
+ print("No comparision branch found, falling back to master")
+ subprocess.check_call(["git", "clone", "git@git.yoctoproject.org:yocto-testresults", tempdir, "--depth", "5"])

# If the base comparision branch isn't present regression comparision won't work
# at least until we can tell the tool to ignore internal branch information
--
2.25.1

Join yocto@lists.yoctoproject.org to automatically receive all group messages.