mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 00:59:48 +00:00
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: 64ed88e32cf9e04772319ff6e66c602d1cff4fd7) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
28324600cb
commit
a88b6d2452
@@ -17,6 +17,7 @@ import boto3
|
|||||||
import configparser
|
import configparser
|
||||||
import mailbox
|
import mailbox
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
greeting = """Thank you for your submission. Patchtest identified one
|
greeting = """Thank you for your submission. Patchtest identified one
|
||||||
@@ -25,10 +26,12 @@ more information:\n\n---\n"""
|
|||||||
|
|
||||||
suggestions = """\n---\n\nPlease address the issues identified and
|
suggestions = """\n---\n\nPlease address the issues identified and
|
||||||
submit a new revision of the patch, or alternatively, reply to this
|
submit a new revision of the patch, or alternatively, reply to this
|
||||||
email with an explanation of why the patch format should be accepted. If
|
email with an explanation of why the patch should be accepted. If you
|
||||||
you believe these results are due to an error in patchtest, please
|
believe these results are due to an error in patchtest, please submit a
|
||||||
submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest'
|
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
|
||||||
category under 'Yocto Project Subprojects'). Thank you!"""
|
under 'Yocto Project Subprojects'). For more information on specific
|
||||||
|
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
|
||||||
|
you!"""
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description="Send patchtest results to a submitter for a given patch")
|
parser = argparse.ArgumentParser(description="Send patchtest results to a submitter for a given patch")
|
||||||
parser.add_argument("-p", "--patch", dest="patch", required=True, help="The patch file to summarize")
|
parser.add_argument("-p", "--patch", dest="patch", required=True, help="The patch file to summarize")
|
||||||
@@ -54,6 +57,10 @@ mbox = mailbox.mbox(args.patch)
|
|||||||
mbox_subject = mbox[0]['subject']
|
mbox_subject = mbox[0]['subject']
|
||||||
subject_line = f"Patchtest results for {mbox_subject}"
|
subject_line = f"Patchtest results for {mbox_subject}"
|
||||||
|
|
||||||
|
# extract the submitter email address and use it as the reply address
|
||||||
|
# for the results
|
||||||
|
reply_address = re.findall("<(.*)>", mbox[0]['from'])
|
||||||
|
|
||||||
if "FAIL" in testresult:
|
if "FAIL" in testresult:
|
||||||
reply_contents = None
|
reply_contents = None
|
||||||
if len(max(open(result_file, 'r'), key=len)) > 220:
|
if len(max(open(result_file, 'r'), key=len)) > 220:
|
||||||
@@ -66,9 +73,9 @@ if "FAIL" in testresult:
|
|||||||
response = ses_client.send_email(
|
response = ses_client.send_email(
|
||||||
Source='patchtest@automation.yoctoproject.org',
|
Source='patchtest@automation.yoctoproject.org',
|
||||||
Destination={
|
Destination={
|
||||||
'ToAddresses': ['test-list@lists.yoctoproject.org'],
|
'CcAddresses': ['openembedded-core@lists.openembedded.org'],
|
||||||
},
|
},
|
||||||
ReplyToAddresses=['test-list@lists.yoctoproject.org'],
|
ReplyToAddresses=reply_address,
|
||||||
Message={
|
Message={
|
||||||
'Subject': {
|
'Subject': {
|
||||||
'Data': subject_line,
|
'Data': subject_line,
|
||||||
|
|||||||
Reference in New Issue
Block a user