Tools/ChangeLog

 12020-08-24 Aakash Jain <aakash_jain@apple.com>
 2
 3 [ews] set references header in email so as to group similar emails together
 4 https://bugs.webkit.org/show_bug.cgi?id=215777
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * BuildSlaveSupport/ews-build/send_email.py:
 9 (send_email): Add support for setting references header.
 10 (send_email_to_patch_author):
 11 (send_email_to_bot_watchers):
 12 * BuildSlaveSupport/ews-build/steps.py:
 13 (AnalyzeCompileWebKitResults.send_email_for_new_build_failure): Set references header appropriately.
 14 (ReRunWebKitTests.send_email_for_flaky_failure): Ditto.
 15 (AnalyzeLayoutTestsResults.send_email_for_flaky_failure): Ditto.
 16 (AnalyzeLayoutTestsResults.send_email_for_pre_existing_failure): Ditto.
 17 (AnalyzeLayoutTestsResults.send_email_for_new_test_failures): Ditto.
 18
1192020-08-24 Jonathan Bedard <jbedard@apple.com>
220
321 [resultsdbpy] Fix pip package
266083

Tools/BuildSlaveSupport/ews-build/send_email.py

@@def get_email_ids(category):
4242 return []
4343
4444
45 def send_email(to_emails, subject, text):
 45def send_email(to_emails, subject, text, reference=''):
4646 if is_test_mode_enabled:
4747 return
4848 if not to_emails:

@@def send_email(to_emails, subject, text)
5959 msg['From'] = FROM_EMAIL
6060 msg['To'] = ', '.join(to_emails)
6161 msg['Subject'] = subject
 62 if reference:
 63 msg.add_header('references', '{}@webkit.org'.format(reference))
6264
6365 server = smtplib.SMTP(SERVER)
6466 server.sendmail(FROM_EMAIL, to_emails, msg.as_string())
6567 server.quit()
6668
6769
68 def send_email_to_patch_author(author_email, subject, text):
 70def send_email_to_patch_author(author_email, subject, text, reference=''):
6971 if not author_email:
7072 return
7173 if author_email in get_email_ids('EMAIL_IDS_TO_UNSUBSCRIBE'):
7274 print('email {} is in unsubscribe list, skipping email'.format(author_email))
7375 return
74  send_email([author_email], subject, text)
 76 send_email([author_email], subject, text, reference)
7577
7678
77 def send_email_to_bot_watchers(subject, text):
78  send_email(get_email_ids('BOT_WATCHERS_EMAILS'), subject, text)
 79def send_email_to_bot_watchers(subject, text, reference=''):
 80 send_email(get_email_ids('BOT_WATCHERS_EMAILS'), subject, text, reference)
266083

Tools/BuildSlaveSupport/ews-build/steps.py

@@class AnalyzeCompileWebKitResults(builds
14901490 logs = logs.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')
14911491 email_text += u'\n\nError lines:\n\n<code>{}</code>'.format(logs)
14921492 email_text += '\n\nTo unsubscrible from these notifications or to provide any feedback please email aakash_jain@apple.com'
1493  send_email_to_patch_author(patch_author, email_subject, email_text)
 1493 send_email_to_patch_author(patch_author, email_subject, email_text, patch_id)
14941494 except Exception as e:
14951495 print('Error in sending email for new build failure: {}'.format(e))
14961496

@@class ReRunWebKitTests(RunWebKitTests):
20272027 email_subject = u'Flaky test: {}'.format(test_name)
20282028 email_text = 'Test {} flaked in {}\n\nBuilder: {}'.format(test_name, build_url, builder_name)
20292029 email_text = 'Flaky test: {}\n\nBuild: {}\n\nBuilder: {}\n\nWorker: {}\n\nHistory: {}'.format(test_name, build_url, builder_name, worker_name, history_url)
2030  send_email_to_bot_watchers(email_subject, email_text)
 2030 send_email_to_bot_watchers(email_subject, email_text, 'flaky-{}'.format(test_name))
20312031 except Exception as e:
20322032 # Catching all exceptions here to ensure that failure to send email doesn't impact the build
20332033 print('Error in sending email for flaky failures: {}'.format(e))

@@class AnalyzeLayoutTestsResults(buildste
21252125
21262126 email_subject = u'Flaky test: {}'.format(test_name)
21272127 email_text = 'Flaky test: {}\n\nBuild: {}\n\nBuilder: {}\n\nWorker: {}\n\nHistory: {}'.format(test_name, build_url, builder_name, worker_name, history_url)
2128  send_email_to_bot_watchers(email_subject, email_text)
 2128 send_email_to_bot_watchers(email_subject, email_text, 'flaky-{}'.format(test_name))
21292129 except Exception as e:
21302130 print('Error in sending email for flaky failure: {}'.format(e))
21312131

@@class AnalyzeLayoutTestsResults(buildste
21382138
21392139 email_subject = u'Pre-existing test failure: {}'.format(test_name)
21402140 email_text = 'Test {} failed on clean tree run in {}.\n\nBuilder: {}\n\nWorker: {}\n\nHistory: {}'.format(test_name, build_url, builder_name, worker_name, history_url)
2141  send_email_to_bot_watchers(email_subject, email_text)
 2141 send_email_to_bot_watchers(email_subject, email_text, 'preexisting-{}'.format(test_name))
21422142 except Exception as e:
21432143 print('Error in sending email for pre-existing failure: {}'.format(e))
21442144

@@class AnalyzeLayoutTestsResults(buildste
21642164 email_text += '\n\nFull details are available at: {}\n\nPatch author: {}'.format(build_url, patch_author)
21652165 email_text += '\n\nLayout test failure{}:\n{}'.format(pluralSuffix, test_names_string)
21662166 email_text += '\n\nTo unsubscrible from these notifications or to provide any feedback please email aakash_jain@apple.com'
2167  send_email_to_patch_author(patch_author, email_subject, email_text)
 2167 send_email_to_patch_author(patch_author, email_subject, email_text, patch_id)
21682168 except Exception as e:
21692169 print('Error in sending email for new layout test failures: {}'.format(e))
21702170
266083