From 174a6427558ed99aff53d71a58aaea56a349a0e1 Mon Sep 17 00:00:00 2001 From: Trevor Gamblin Date: Tue, 24 Oct 2023 09:14:48 -0400 Subject: 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: 86d00a1b5233250fbea32113ad9c43bd78778406) Signed-off-by: Trevor Gamblin Signed-off-by: Richard Purdie (cherry picked from commit 98ca0b151517b3544454fd5c1656a2de631c4897) Signed-off-by: Steve Sakoman --- scripts/patchtest-send-results | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts/patchtest-send-results') diff --git a/scripts/patchtest-send-results b/scripts/patchtest-send-results index 15ee5b077f..bb4604aeaf 100755 --- a/scripts/patchtest-send-results +++ b/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') -- cgit v1.2.3-54-g00ecf