Title: [265341] trunk/Tools
Revision
265341
Author
aakash_j...@apple.com
Date
2020-08-06 11:38:07 -0700 (Thu, 06 Aug 2020)

Log Message

[ews] Add method to send email notifications to patch author for build failure
https://bugs.webkit.org/show_bug.cgi?id=215219

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(AnalyzeCompileWebKitResults.send_email_for_new_build_failure): Method to send the email for build failure by the patch.
(BugzillaMixin._is_bug_closed): Set bug_title as a build property so that it can be used later.

Modified Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/ews-build/steps.py (265340 => 265341)


--- trunk/Tools/BuildSlaveSupport/ews-build/steps.py	2020-08-06 18:34:39 UTC (rev 265340)
+++ trunk/Tools/BuildSlaveSupport/ews-build/steps.py	2020-08-06 18:38:07 UTC (rev 265341)
@@ -29,7 +29,7 @@
 from twisted.internet import defer
 
 from layout_test_failures import LayoutTestFailures
-from send_email import send_email_to_bot_watchers
+from send_email import send_email, send_email_to_bot_watchers
 
 import json
 import re
@@ -508,6 +508,7 @@
             return -1
 
         bug_title = bug_json.get('summary')
+        self.setProperty('bug_title', bug_title)
         sensitive = bug_json.get('product') == 'Security'
         if sensitive:
             self.setProperty('sensitive', True)
@@ -1442,6 +1443,26 @@
                 filtered_logs.append(line)
         return '\n'.join(filtered_logs[:max_num_lines])
 
+    def send_email_for_new_build_failure(self):
+        try:
+            builder_name = self.getProperty('buildername', '')
+            bug_title = self.getProperty('bug_title', '')
+            worker_name = self.getProperty('workername', '')
+            patch_id = self.getProperty('patch_id', '')
+            patch_author = self.getProperty('patch_author', '')
+            build_url = '{}#/builders/{}/builds/{}'.format(self.master.config.buildbotURL, self.build._builderid, self.build.number)
+            logs = self.filter_logs_containing_error(self.error_logs.get(self.compile_webkit_step))
+
+            email_subject = 'Build failure for Patch {}: {}'.format(patch_id, bug_title)
+            email_text = 'EWS has detected build failure on {} while testing Patch {}.'.format(builder_name, patch_id)
+            email_text += '\n\nFull details are available at: {}\n\nPatch author: {}'.format(build_url, patch_author)
+            if logs:
+                email_text += '\n\nError lines:\n\n{}'.format(logs)
+            email_text += '\n\nTo unsubscrible from these notifications or to provide any feedback please email aakash_j...@apple.com'
+            send_email([patch_author], email_subject, email_text)
+        except Exception as e:
+            print('Error in sending email for new build failure: {}'.format(e))
+
     def send_email_for_preexisting_build_failure(self):
         try:
             builder_name = self.getProperty('buildername', '')

Modified: trunk/Tools/ChangeLog (265340 => 265341)


--- trunk/Tools/ChangeLog	2020-08-06 18:34:39 UTC (rev 265340)
+++ trunk/Tools/ChangeLog	2020-08-06 18:38:07 UTC (rev 265341)
@@ -1,3 +1,14 @@
+2020-08-06  Aakash Jain  <aakash_j...@apple.com>
+
+        [ews] Add method to send email notifications to patch author for build failure
+        https://bugs.webkit.org/show_bug.cgi?id=215219
+
+        Reviewed by Jonathan Bedard.
+
+        * BuildSlaveSupport/ews-build/steps.py:
+        (AnalyzeCompileWebKitResults.send_email_for_new_build_failure): Method to send the email for build failure by the patch.
+        (BugzillaMixin._is_bug_closed): Set bug_title as a build property so that it can be used later.
+
 2020-08-06  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Remove UIScriptController.removeAllDynamicDictionaries()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to