Setting extraRecipients before sending the message

This commit is contained in:
Sergio Durigan Junior 2016-07-24 00:31:02 -04:00
parent e031f46ba3
commit f3d40099ba
2 changed files with 7 additions and 7 deletions

View file

@ -53,7 +53,7 @@
"builders" : [ { "name" : "Fedora-x86_64-m64", "type" : "Plain_c64t64", "builders" : [ { "name" : "Fedora-x86_64-m64", "type" : "Plain_c64t64",
"builddir" : "fedora-x86-64", "builddir" : "fedora-x86-64",
"PATH" : "/usr/local/bin:/usr/bin:/bin", "PATH" : "/usr/local/bin:/usr/bin:/bin",
"tags" : [ "fedora", "x86_64", "m64", "MAIL" ], "tags" : [ "fedora", "x86_64", "m64", "MAIL", "TRY" ],
"slavenames" : [ "fedora-x86-64-1", "fedora-x86-64-2", "slavenames" : [ "fedora-x86-64-1", "fedora-x86-64-2",
"fedora-x86-64-3", "fedora-x86-64-4" ] }, "fedora-x86-64-3", "fedora-x86-64-4" ] },

View file

@ -179,7 +179,7 @@ def SendRootMessageGDBTesters (branch, change, rev,
text += "Commit tested against: %s\n\n" % rev text += "Commit tested against: %s\n\n" % rev
text += "Patch tested:\n\n" text += "Patch tested:\n\n"
text += change.body text += change
chg_title = "Try Build against commit %s" % rev chg_title = "Try Build against commit %s" % rev
text = text.encode ('ascii', 'ignore').decode ('ascii') text = text.encode ('ascii', 'ignore').decode ('ascii')
@ -198,7 +198,6 @@ def SendRootMessageGDBTesters (branch, change, rev,
else: else:
mail['To'] = try_to mail['To'] = try_to
mailto = try_to mailto = try_to
print "==== MEU MAILTO %s" % mailto
mail['Message-Id'] = "<%s-try@gdb-build>" % rev mail['Message-Id'] = "<%s-try@gdb-build>" % rev
s = smtplib.SMTP ('localhost') s = smtplib.SMTP ('localhost')
@ -416,7 +415,7 @@ send to the gdb-testers mailing list."""
git_url = "http://gdb-build.sergiodj.net/cgit" git_url = "http://gdb-build.sergiodj.net/cgit"
branch = build.getSourceStamps ()[0].branch branch = build.getSourceStamps ()[0].branch
sourcestamp = build.getSourceStamps ()[0] sourcestamp = build.getSourceStamps ()[0]
cur_change = sourcestamp.patch[0] cur_change = sourcestamp.patch[1]
properties = build.getProperties () properties = build.getProperties ()
isrebuild = properties.getProperty ('isRebuild') isrebuild = properties.getProperty ('isRebuild')
@ -546,12 +545,13 @@ scheduler."""
if prop.startswith ('racy'): if prop.startswith ('racy'):
return False return False
elif prop.startswith ('try'): elif prop.startswith ('try'):
if not self.sendToInterestedUsers: if "TRY" not in self.tags:
# This means we're dealing with mn. We only send # This means we're dealing with mn. We only send
# e-mail on mn_try. # e-mail on mn_try.
return False return False
self.extraRecipients = [ build.getReason ().strip ("'try' job by user ") ]
else: else:
if self.sendToInterestedUsers: if "TRY" in self.tags:
# We're dealing with mn_try. # We're dealing with mn_try.
return False return False
return mail.MailNotifier.isMailNeeded (self, build, results) return mail.MailNotifier.isMailNeeded (self, build, results)
@ -570,7 +570,7 @@ mn_try = MyMailNotifier(fromaddr = GDB_MAIL_FROM,
sendToInterestedUsers = True, sendToInterestedUsers = True,
mode = ( 'failing', 'passing', 'warnings' ), mode = ( 'failing', 'passing', 'warnings' ),
messageFormatter = MessageGDBTestersTryBuild, messageFormatter = MessageGDBTestersTryBuild,
tags = [ "MAIL" ], tags = [ "MAIL", "TRY" ],
extraHeaders = { 'X-GDB-Buildbot' : '1', extraHeaders = { 'X-GDB-Buildbot' : '1',
'In-Reply-To' : WithProperties ("<%s-try@gdb-build>", 'In-Reply-To' : WithProperties ("<%s-try@gdb-build>",
'got_revision') }) 'got_revision') })