瀏覽代碼

patchtest-send-results: improve subject line

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.

(From OE-Core rev: 98ca0b151517b3544454fd5c1656a2de631c4897)

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Trevor Gamblin 1 年之前
父節點
當前提交
e66dcd89b4
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      scripts/patchtest-send-results

+ 6 - 1
scripts/patchtest-send-results

@@ -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')