[Buildbot-devel] patch for review: mail.MailNotifier support for 'passing' mode?

Matisse Enzer matisse at matisse.net
Mon Jan 14 02:26:14 UTC 2008


On Jan 13, 2008, at 3:48 PM, Dustin J. Mitchell wrote:

> On Jan 13, 2008 1:27 PM, Matisse Enzer <matisse at matisse.net> wrote:
>> I wanted to send email with a different Subject line for passing
>> builds, so I made the following changes to buildbot/status/mail.py
>>
>> This supports a new MailNotifer mode of 'passing'
>
> You'll need to update the docstring to MailNotifier.__init__ to
> indicate the new allowable 'mode'.  Other than that, looks fine to me.
> Other comments?


I will also see if I can add a unit test.

Good catch - I now have:

--- /usr/lib/python2.4/site-packages/buildbot/status/mail.py.dist	 
2008-01-13 09:21:23.000000000 -0800
+++ /usr/lib/python2.4/site-packages/buildbot/status/mail.py	 
2008-01-13 11:30:10.000000000 -0800
@@ -100,6 +100,7 @@
          @param mode: one of:
                       - 'all': send mail about all builds, passing  
and failing
                       - 'failing': only send mail about builds which  
fail
+                     - 'passing': only send mail about builds which  
succeed
                       - 'problem': only send mail about a build which  
failed
                       when the previous build passed

@@ -208,6 +209,8 @@

          if self.mode == "failing" and results != FAILURE:
              return
+        if self.mode == "passing" and results != SUCCESS:
+            return
          if self.mode == "problem":
              if results != FAILURE:
                  return
@@ -228,6 +231,8 @@
              text += "The Buildbot has finished a build of %s.\n" %  
name
          elif self.mode == "failing":
              text += "The Buildbot has detected a failed build of %s. 
\n" % name
+        elif self.mode == "passing":
+            text += "The Buildbot has detected a passing build of %s. 
\n" % name
          else:
              text += "The Buildbot has detected a new failure of %s. 
\n" % name
          buildurl = self.status.getURLForThing(build)









More information about the devel mailing list