diff options
author | Trevor Gamblin <tgamblin@baylibre.com> | 2023-10-30 11:44:41 -0400 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2023-11-24 05:01:37 -1000 |
commit | 44dd3383c73029d24571128fe8d2aa464ba02600 (patch) | |
tree | f5497e588c2cd5d972482fe68ea7534da843a46b | |
parent | cce3cab334fc5f079b436c28d2ae3008dfda1b53 (diff) | |
download | poky-44dd3383c73029d24571128fe8d2aa464ba02600.tar.gz |
patchtest-send-results: send results to submitter
Modify patchtest-send-results so that it extracts the submitter's email
address and responds to them with the patch testresults. Also make a
minor adjustment to the suggestions provided with each email and include
a link to the Patchtest wiki page for additional clarification on
specific failures.
(From OE-Core rev: fe9ec57a07f4e341505030fdf49a5827f01a626f)
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 64ed88e32cf9e04772319ff6e66c602d1cff4fd7)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rwxr-xr-x | scripts/patchtest-send-results | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/scripts/patchtest-send-results b/scripts/patchtest-send-results index 078651ec38..01b071159b 100755 --- a/scripts/patchtest-send-results +++ b/scripts/patchtest-send-results | |||
@@ -17,6 +17,7 @@ import boto3 | |||
17 | import configparser | 17 | import configparser |
18 | import mailbox | 18 | import mailbox |
19 | import os | 19 | import os |
20 | import re | ||
20 | import sys | 21 | import sys |
21 | 22 | ||
22 | greeting = """Thank you for your submission. Patchtest identified one | 23 | greeting = """Thank you for your submission. Patchtest identified one |
@@ -25,10 +26,12 @@ more information:\n\n---\n""" | |||
25 | 26 | ||
26 | suggestions = """\n---\n\nPlease address the issues identified and | 27 | suggestions = """\n---\n\nPlease address the issues identified and |
27 | submit a new revision of the patch, or alternatively, reply to this | 28 | submit a new revision of the patch, or alternatively, reply to this |
28 | email with an explanation of why the patch format should be accepted. If | 29 | email with an explanation of why the patch should be accepted. If you |
29 | you believe these results are due to an error in patchtest, please | 30 | believe these results are due to an error in patchtest, please submit a |
30 | submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' | 31 | bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category |
31 | category under 'Yocto Project Subprojects'). Thank you!""" | 32 | under 'Yocto Project Subprojects'). For more information on specific |
33 | failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank | ||
34 | you!""" | ||
32 | 35 | ||
33 | parser = argparse.ArgumentParser(description="Send patchtest results to a submitter for a given patch") | 36 | parser = argparse.ArgumentParser(description="Send patchtest results to a submitter for a given patch") |
34 | parser.add_argument("-p", "--patch", dest="patch", required=True, help="The patch file to summarize") | 37 | parser.add_argument("-p", "--patch", dest="patch", required=True, help="The patch file to summarize") |
@@ -54,6 +57,10 @@ mbox = mailbox.mbox(args.patch) | |||
54 | mbox_subject = mbox[0]['subject'] | 57 | mbox_subject = mbox[0]['subject'] |
55 | subject_line = f"Patchtest results for {mbox_subject}" | 58 | subject_line = f"Patchtest results for {mbox_subject}" |
56 | 59 | ||
60 | # extract the submitter email address and use it as the reply address | ||
61 | # for the results | ||
62 | reply_address = re.findall("<(.*)>", mbox[0]['from']) | ||
63 | |||
57 | if "FAIL" in testresult: | 64 | if "FAIL" in testresult: |
58 | reply_contents = None | 65 | reply_contents = None |
59 | if len(max(open(result_file, 'r'), key=len)) > 220: | 66 | if len(max(open(result_file, 'r'), key=len)) > 220: |
@@ -66,9 +73,9 @@ if "FAIL" in testresult: | |||
66 | response = ses_client.send_email( | 73 | response = ses_client.send_email( |
67 | Source='patchtest@automation.yoctoproject.org', | 74 | Source='patchtest@automation.yoctoproject.org', |
68 | Destination={ | 75 | Destination={ |
69 | 'ToAddresses': ['test-list@lists.yoctoproject.org'], | 76 | 'CcAddresses': ['openembedded-core@lists.openembedded.org'], |
70 | }, | 77 | }, |
71 | ReplyToAddresses=['test-list@lists.yoctoproject.org'], | 78 | ReplyToAddresses=reply_address, |
72 | Message={ | 79 | Message={ |
73 | 'Subject': { | 80 | 'Subject': { |
74 | 'Data': subject_line, | 81 | 'Data': subject_line, |