1

I have buildbot running with 2 builders. The first builder performs build steps, then triggers (via triggerable scheduler) the second builder which performs tests. There is 3 schedulers: SingleBranch, Force and try, which trigger 1st builder, also there is 2 mail notifiers:

for mode, builders in (('warnings', ['Build', 'Test']),
                   ('passing', ['Test'])):
   c['status'].append(MailNotifier(fromaddr='...',
                                   sendToInterestedUsers=True,
                                   extraRecipients=['...'],
                                   mode=mode,
                                   builders=builders,
                                   ))

So one notifier sends reports about fails for both Build and Test builders and another notifier sends reports about success only for Test builder(it means build was successful too). Currently mail notifier send reports for all three schedulers that activate Build builder. Question: is it possible to make notifiers work just for SingleBranch scheduler?

Thanks in advance.

1 Answers1

1

There's no easy way to do this. However it is possible to do what you want:

class MyMailNotifier(MailNotifier):
    def isMailNeeded(self, build, results):
        if build.properties.getProperty('scheduler') == '<SingleBranchSchedulerName>':
            return MailNotifier.isMailNeeded(self, build, results)
        else:
            return False

While this code is not tested, I'm quite confident it does what you'd like.

  • Thanks, that's good idea. Though, scheduler for test builder is always triggerable, so I can't use this code without modification. But I'll try to pass scheduler of previous (building) builder by another arg. – Alex Batrakov May 13 '15 at 15:18