[autobuilder-helper,warrior,35/41] send-qa-email: Fix stable branch test result history issues
Submitted by Richard Purdie on Sept. 10, 2020, 12:25 p.m.
|
Patch ID: 176315
Details
Commit Message
@@ -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
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(-)