[Buildbot-devel] Per-branch change status for MailNotifier?

Trask trask at techsoft3d.com
Fri Jul 6 00:42:25 UTC 2012


While making some improvements to our Buildbot instance I was surprised 
to discover that the 'change' mode of the MailNotifier ignores the 
branch on which the change occurred.  This means if one commit breaks 
the "master" branch and then another commit on "release-1.1" builds 
correctly, we get a "build succeeded" email based upon the "release-1.1" 
commit but in reality the build is still broken on the "master" branch.

Am I missing an option somewhere to have the MailNotifier only "care" 
about the changes in the "same" branch as the current build?

Is making a separate builder for each branch the suggested solution to 
this issue?

For now we have hacked this change into status/build.py and adjusted the 
mail.py accordingly:

(running 0.8.6p1)

================================
# ORIGINAL
     def getPreviousBuild(self):
         if self.number == 0:
             return None
         return self.builder.getBuild(self.number-1

================================
# HACKED
     def getPreviousBuild(self, branchSpecific=False):
         if self.number == 0:
             return None

         if branchSpecific and self.properties.getProperty('branch'):
             for i in range(1,100):
                 tmpBuild = self.builder.getBuild(self.number-i)
                 if tmpBuild.properties.getProperty('branch') == 
self.properties.getProperty('branch'):
                     return tmpBuild
         else:
             return self.builder.getBuild(self.number-1)

================================


Thanks,


~Trask




More information about the devel mailing list