[Buildbot-devel] Patch proposal: include the project name in mails sent.

Benoit Sigoure tsuna at lrde.epita.fr
Sat Mar 31 22:46:51 UTC 2007


Hello list,

I've been intensively using buildbot for half a year now (still haven't
switched to 0.7.5 though). I have more than a dozen of projects building
with seven different compilers on multiple OSes. I recently changed the way
our builders were named so that their name is the full name of the compiler
used to build the project (eg, `mipsel-linux-gcc-3.3.2'). Unfortunately,
when the buildbot sends an email when a build fails, it only mention the
name of the builder which makes it hard to quickly know which project
failed.

So I wrote a little patched against 0.7.4 to also include the projectName in
the title and body of the mail. The patched is attached.
(if my webmail happens to wrap lines or whatever, you can also download the
patch from http://www.tsunanet.net/~tsuna/buildbot-mail-projectName.patch)

I hope it will be applied and helpful to other buildbot users.

Once again, thank you very much for this wonderful life-changing piece of
software.

Cheers,

-- 
SIGOURE Benoit aka Tsuna
   _____
  /EPITA\ Promo 2008, LRDE
-------------- next part --------------
--- buildbot-0.7.4/buildbot/status/mail.py	2006-08-23 09:11:16.000000000 +0200
+++ /usr/lib/python2.3/site-packages/buildbot/status/mail.py	2007-04-01 00:26:08.000000000 +0200
@@ -72,14 +72,14 @@
 
     def __init__(self, fromaddr, mode="all", categories=None, builders=None,
                  addLogs=False, relayhost="localhost",
-                 subject="buildbot %(result)s in %(builder)s",
+                 subject="buildbot %(result)s in %(projectName)s on %(builder)s",
                  lookup=None, extraRecipients=[],
                  sendToInterestedUsers=True):
         """
@@ -226,11 +226,12 @@
     def buildMessage(self, name, build, results):
         text = ""
         if self.mode == "all":
-            text += "The Buildbot has finished a build of %s.\n" % name
+            text += "The Buildbot has finished a build"
         elif self.mode == "failing":
-            text += "The Buildbot has detected a failed build of %s.\n" % name
+            text += "The Buildbot has detected a failed build"
         else:
-            text += "The Buildbot has detected a new failure of %s.\n" % name
+            text += "The Buildbot has detected a new failure"
+        text += "of %s on %s.\n" % (name, self.parent.projectName)
         buildurl = self.status.getURLForThing(build)
         if buildurl:
             text += "Full details are available at:\n %s\n" % buildurl
@@ -313,6 +314,7 @@
 
         m['Date'] = formatdate(localtime=True)
         m['Subject'] = self.subject % { 'result': res,
+                                        'projectName': self.parent.projectName,
                                         'builder': name,
                                         }
         m['From'] = self.fromaddr


More information about the devel mailing list