]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
patchtest-send-results: improve subject line
authorTrevor Gamblin <tgamblin@baylibre.com>
Tue, 24 Oct 2023 13:14:48 +0000 (09:14 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 24 Oct 2023 13:21:25 +0000 (14:21 +0100)
Pull the actual email's subject line from the .mbox file and use that in
patchtest's test results response, so that it's clearer which patch it
is replying to.

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/patchtest-send-results

index 15ee5b077fc73a2c38ded724b798ae2c094086f9..bb4604aeaf1eae9a9e5331ee08d4d93cfac2def4 100755 (executable)
@@ -53,7 +53,12 @@ with open(result_file, "r") as f:
     testresult = f.read()
 
 reply_contents = greeting + testresult + suggestions
-subject_line = f"Patchtest results for {result_basename}"
+
+# we know these patch files will only contain a single patch, so only
+# worry about the first element for getting the subject
+mbox = mailbox.mbox(args.patch)
+mbox_subject = mbox[0]['subject']
+subject_line = f"Patchtest results for {mbox_subject}"
 
 if "FAIL" in testresult:
     ses_client = boto3.client('ses', region_name='us-west-2')