diff mbox series

[yocto-autobuilder-helper] send_qa_email: Only copy logs when we are pushing tags

Message ID 20251230-mathieu-fix-15696-v1-1-a364776c47b5@bootlin.com
State New
Headers show
Series [yocto-autobuilder-helper] send_qa_email: Only copy logs when we are pushing tags | expand

Commit Message

Mathieu Dubois-Briand Dec. 30, 2025, 5:47 p.m. UTC
Resulttool creates tags in yocto-testresults and copies logs in an NFS
shared folder whose name is based on this tag. If we are never going to
push this tag, we should not copy the logs, in order to maintain some
coherency.

Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
---
 scripts/send_qa_email.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)


---
base-commit: 6f793956c9b43f7a74f5a22c86a93b744b21ada9
change-id: 20251230-mathieu-fix-15696-788af5e206c5

Best regards,
diff mbox series

Patch

diff --git a/scripts/send_qa_email.py b/scripts/send_qa_email.py
index 23114a47da11..2755df9f30f7 100755
--- a/scripts/send_qa_email.py
+++ b/scripts/send_qa_email.py
@@ -203,7 +203,15 @@  def send_qa_email():
             utils.printheader("Storing results")
 
             if not args.dry_run:
-                subprocess.check_call([resulttool, "store", "--revision", revision, "-l", args.results_dir + "/../../testresult-logarchives" , args.results_dir, tempdir])
+                cmd = [resulttool, "store", "--revision", revision, args.results_dir, tempdir]
+
+                # Ask resulttool to store logs in log archive folder. We should
+                # only do this when tags are pushed, as tags and log folder have
+                # to match.
+                if basebranch or targetbranch:
+                    cmd.extend(["-l", args.results_dir + "/../../testresult-logarchives"])
+
+                subprocess.check_call(cmd)
                 if basebranch:
                     subprocess.check_call(["git", "push", "--all", "--force"], cwd=tempdir)
                     subprocess.check_call(["git", "push", "--tags", "--force"], cwd=tempdir)