[Buildbot-devel] Possibilities for GotRevision on email notification?

Brian Warner warner-buildbot at lothar.com
Thu Sep 18 21:54:52 UTC 2008

> I just got a request from one of the developers here to include the 
> revision number of the build into the subject of the build
> notification email that gets sent out at the end of every build.  So
> far, I am unable to do this, and was wondering if anybody else out
> there has done this before.

I haven't done this before, but I'd try subclassing MailNotifier, override
buildMessage (you may have to copy most of it into your subclass.. it isn't
very well designed for this sort of thing), and add code like:

   revision = "r" + build.getProperty("got_revision")
 except KeyError:
   revision = ""
 m['Subject'] = "stuff rev=%s" % revision

We could probably use an extra delegate-to-self call in the end of
MailNotifier, to make this easier: a method that could be overridden to
modify the email before it gets handed off to the SMTP delivery method.
Patches welcome :).


More information about the devel mailing list