Package buildbot :: Package status :: Module mail :: Class MailNotifier
[frames | no frames]

Class MailNotifier

       ComparableMixin --+    
                         |    
           Service --+   |    
                     |   |    
          MultiService --+    
                         |    
        StatusReceiver --+    
                         |    
StatusReceiverMultiService --+
                             |
                            MailNotifier

Known Subclasses:
TinderboxMailNotifier

This is a status notifier which sends email to a list of recipients upon the completion of each build. It can be configured to only send out mail for certain builds, and only send messages when the build fails, or when it transitions from success to failure. It can also be configured to include various build logs in each message.

By default, the message will be sent to the Interested Users list, which includes all developers who made changes in the build. You can add additional recipients with the extraRecipients argument.

To get a simple one-message-per-build (say, for a mailing list), use sendToInterestedUsers=False, extraRecipients=['listaddr@example.org']

Each MailNotifier sends mail to a single set of recipients. To send different kinds of mail to different recipients, use multiple MailNotifiers.
Method Summary
  __init__(self, fromaddr, mode, categories, builders, addLogs, relayhost, subject, lookup, extraRecipients, sendToInterestedUsers)
  builderAdded(self, name, builder)
  builderChangedState(self, name, state)
  builderRemoved(self, name)
  buildFinished(self, name, build, results)
  buildMessage(self, name, build, results)
  buildStarted(self, name, build)
  disownServiceParent(self)
  sendMessage(self, m, recipients)
  setServiceParent(self, parent)
  setup(self)
    Inherited from StatusReceiver
  buildETAUpdate(self, build, ETA)
  buildsetSubmitted(self, buildset)
  logChunk(self, build, step, log, channel, text)
  logFinished(self, build, step, log)
  logStarted(self, build, step, log)
  stepETAUpdate(self, build, step, ETA, expectations)
  stepFinished(self, build, step, results)
  stepStarted(self, build, step)
    Inherited from MultiService
  __iter__(self)
  addService(self, service)
  getServiceNamed(self, name)
  privilegedStartService(self)
  removeService(self, service)
  startService(self)
  stopService(self)
    Inherited from Service
  __getstate__(self)
  setName(self, name)
    Inherited from ComparableMixin
  __cmp__(self, them)
  __hash__(self)

Class Variable Summary
Implements __implemented__ = <implementedBy buildbot.status.mail.Ma...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...
list compare_attrs = ['extraRecipients', 'lookup', 'fromaddr'...
    Inherited from StatusReceiver
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...
    Inherited from Service
NoneType name = None                                                                  
NoneType parent = None                                                                  
int running = 0                                                                     

Method Details

__init__(self, fromaddr, mode='all', categories=None, builders=None, addLogs=False, relayhost='localhost', subject='buildbot %(result)s in %(builder)s', lookup=None, extraRecipients=[], sendToInterestedUsers=True)
(Constructor)

Parameters:
fromaddr - the email address to be used in the 'From' header.
           (type=string)
mode - one of:
  • 'all': send mail about all builds, passing and failing
  • 'failing': only send mail about builds which fail
  • 'problem': only send mail about a build which failed when the previous build passed

           (type=string (defaults to all))
categories - a list of category names to serve status information for. Defaults to None (all categories). Use either builders or categories, but not both.
           (type=list of strings)
builders - a list of builder names for which mail should be sent. Defaults to None (send mail for all builds). Use either builders or categories, but not both.
           (type=list of strings)
addLogs - if True, include all build logs as attachments to the messages. These can be quite large. This can also be set to a list of log names, to send a subset of the logs. Defaults to False.
           (type=boolean.)
relayhost - the host to which the outbound SMTP connection should be made. Defaults to 'localhost'
           (type=string)
subject - a string to be used as the subject line of the message. %(builder)s will be replaced with the name of the builder which provoked the message.
           (type=string)
lookup - object which provides IEmailLookup, which is responsible for mapping User names (which come from the VC system) into valid email addresses. If not provided, the notifier will only be able to send mail to the addresses in the extraRecipients list. Most of the time you can use a simple Domain instance. As a shortcut, you can pass as string: this will be treated as if you had provided Domain(str). For example, lookup='twistedmatrix.com' will allow mail to be sent to all developers whose SVN usernames match their twistedmatrix.com account names.
           (type=implementor of {IEmailLookup})
extraRecipients - a list of email addresses to which messages should be sent (in addition to the InterestedUsers list, which includes any developers who made Changes that went into this build). It is a good idea to create a small mailing list and deliver to that, then let subscribers come and go as they please.
           (type=tuple of string)
sendToInterestedUsers - if True (the default), send mail to all of the Interested Users. If False, only send mail to the extraRecipients list.
           (type=boolean)
Overrides:
buildbot.status.base.StatusReceiverMultiService.__init__

setServiceParent(self, parent)

Parameters:
parent
           (type=buildbot.master.BuildMaster)
Overrides:
twisted.application.service.Service.setServiceParent

Class Variable Details

__implemented__

Type:
Implements
Value:
<implementedBy buildbot.status.mail.MailNotifier>                      

__provides__

Type:
ClassProvides
Value:
<zope.interface.declarations.ClassProvides object at 0x4140126c>       

compare_attrs

Type:
list
Value:
['extraRecipients',
 'lookup',
 'fromaddr',
 'mode',
 'categories',
 'builders',
 'addLogs',
 'relayhost',
...                                                                    

Generated by Epydoc 2.1 on Sun Dec 10 22:04:45 2006 http://epydoc.sf.net