Skip to content
Permalink
Browse files
[EWS] Support PRs when sending build failure emails (Follow-up fix)
https://bugs.webkit.org/show_bug.cgi?id=235926
<rdar://problem/88302122>

Reviewed by Aakash Jain.

* Tools/CISupport/ews-build/steps.py:
(GitHub.email_for_owners): Return error string.
(AnalyzeCompileWebKitResults.send_email_for_new_build_failure): Log error
from email_from_owners to buildbot stdio.


Canonical link: https://commits.webkit.org/247296@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289854 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
JonWBedard committed Feb 15, 2022
1 parent bac0164 commit 15e21e68c5381788f85851bb3fb1db3afa52faa9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
@@ -130,8 +130,7 @@ def credentials(cls):
@classmethod
def email_for_owners(cls, owners):
if not owners:
print('No owners defined, so email cannot be extracted')
return None
return None, 'No owners defined, so email cannot be extracted'
contributors, errors = Contributors.load(use_network=False)
return contributors.get(owners[0], {}).get('email'), errors

@@ -2172,7 +2171,7 @@ def send_email_for_new_build_failure(self):
if pr_number and not self.should_send_email_for_pr(pr_number):
return
if not patch_id and not (pr_number and sha):
print('Unrecognized change type')
self._addToLog('Unrecognized change type')
return

change_string = None
@@ -2185,9 +2184,10 @@ def send_email_for_new_build_failure(self):
change_author, errors = GitHub.email_for_owners(self.getProperty('owners', []))
for error in errors:
print(error)
self._addToLog('stdio', error)

if not change_author:
print('Failed to determine change author for hash {} belonging to PR #{}'.format(sha, patch_id))
self._addToLog('Unable to determine email address for {} from metadata/contributors.json. Skipping sending email.'.format(self.getProperty('owners', [])))

This comment has been minimized.

Copy link
@aj062

aj062 Feb 15, 2022

Member

should it be owners or owners[0]? (to be just the string instead of list)

This comment has been minimized.

Copy link
@JonWBedard

JonWBedard Feb 15, 2022

Author Member

I used the whole list because if you find yourself here, there is a good chance owners is actually an empty list or something weird we aren't expecting.

return

builder_name = self.getProperty('buildername', '')
@@ -1,3 +1,16 @@
2022-02-15 Jonathan Bedard <jbedard@apple.com>

[EWS] Support PRs when sending build failure emails (Follow-up fix)
https://bugs.webkit.org/show_bug.cgi?id=235926
<rdar://problem/88302122>

Reviewed by Aakash Jain.

* CISupport/ews-build/steps.py:
(GitHub.email_for_owners): Return error string.
(AnalyzeCompileWebKitResults.send_email_for_new_build_failure): Log error
from email_from_owners to buildbot stdio.

2022-02-15 Sihui Liu <sihui_liu@apple.com>

Unreviewed build fix after r288478.

0 comments on commit 15e21e6

Please sign in to comment.