Next: , Previous: MailNotifier, Up: Status Targets

4.13.3 IRC Bot

The buildbot.status.words.IRC status target creates an IRC bot which will attach to certain channels and be available for status queries. It can also be asked to announce builds as they occur, or be told to shut up.

     from buildbot.status import words
     irc = words.IRC("", "botnickname",
                     channels=["channel1", "channel2"],
                       'exception': 1,
                       'successToFailure': 1,
                       'failureToSuccess': 1,

Take a look at the docstring for words.IRC for more details on configuring this service. Note that the useSSL option requires PyOpenSSL. The password argument, if provided, will be sent to Nickserv to claim the nickname: some IRC servers will not allow clients to send private messages until they have logged in with a password.

To use the service, you address messages at the buildbot, either normally (botnickname: status) or with private messages (/msg botnickname status). The buildbot will respond in kind.

Some of the commands currently available:

list builders
Emit a list of all configured builders
status BUILDER
Announce the status of a specific Builder: what it is doing right now.
status all
Announce the status of all Builders
If the given Builder is currently running, wait until the Build is finished and then announce the results.
Return the results of the last build to run on the given Builder.
notify on|off|list EVENT
Report events relating to builds. If the command is issued as a private message, then the report will be sent back as a private message to the user who issued the command. Otherwise, the report will be sent to the channel. Available events to be notified are:
A build has started
A build has finished
A build finished successfully
A build failed
A build generated and exception
The previous build was x, but this one is Y, where x and Y are each one of success, warnings, failure, exception (except Y is capitalized). For example: successToFailure will notify if the previous build was successful, but this one failed

Describe a command. Use help commands to get a list of known commands.
Announce the URL of the Buildbot's home page.
Announce the version of this Buildbot.

Additionally, the config file may specify default notification options as shown in the example earlier.

If the allowForce=True option was used, some addtional commands will be available:

force build BUILDER REASON
Tell the given Builder to start a build of the latest code. The user requesting the build and REASON are recorded in the Build status. The buildbot will announce the build's status when it finishes.
Terminate any running build in the given Builder. REASON will be added to the build status to explain why it was stopped. You might use this if you committed a bug, corrected it right away, and don't want to wait for the first build (which is destined to fail) to complete before starting the second (hopefully fixed) build.