Ticket #171 (closed enhancement: fixed)

Opened 1 year ago

Last modified 6 months ago

Notify build events

Reported by: nhemingway Assigned to: nhemingway
Priority: minor Milestone: 0.7.8
Component: other Version: 0.7.6
Keywords: Cc: amveer, TTimo, nhemingway, dustin

Description

The IRC daemon should be able to notify clients of build events. Ideally, it should be able to discriminate between (and notify about) the following build events: * starting * finishing * succeeding * failing * encountering an exception * transitioning from success to failure (the previous build for this branch succeeded, but this one failed) * transitioning from failure to success

Attachments

irc.patch (9.1 kB) - added by nhemingway on 01/20/08 14:12:10.
first solution
irc-notify.patch (11.8 kB) - added by avmeer on 02/01/08 11:38:10.
buildbot_irc.diff (18.9 kB) - added by nhemingway on 04/22/08 13:57:43.
replacement unified diff (implements state change notification, the repr change and the second clause of the condition)

Change History

01/20/08 14:08:41 changed by nhemingway

  • status changed from new to assigned.

01/20/08 14:12:10 changed by nhemingway

  • attachment irc.patch added.

first solution

02/01/08 11:37:16 changed by avmeer

Updated a unified diff patch to the CVS trunk as of 2008-01-30.

02/01/08 11:38:10 changed by avmeer

  • attachment irc-notify.patch added.

04/16/08 12:51:30 changed by TTimo

patch applies ok to 0.7.7, but line 297 of words.py: r += "%d" % change.revision throws an exception for me, I changed it to: r += repr( change.revision ) (which seems to be None on my systems)

wishlist: - save settings between restarts - identify state changes rather than repeated 'failed' or 'success' - better status messaging, or customizable somehow. My pref:

SUCCESS: <builder name> FAILURE: <builder name> START : <builder name> etc.

04/17/08 06:34:01 changed by dustin

  • cc set to amveer, TTimo, nhemingway, dustin.

I don't use the IRC module, so I don't have a good way to judge whether this is acceptable just yet. It has all of the principal components: code, tests, and docs. TTimo, your wishlist items all seem like they could be addressed by subsequent patches, right?

Your repr() change is correct -- change.revision can be None or a string, and should not be an integer.

Let me know if you think this should or should not go into the development branch, and I'll act accordingly.

04/17/08 08:45:01 changed by TTimo

sure, I think this can go into the main code

04/17/08 09:23:47 changed by dustin

Hmm, one problem -- I have twisted.words 0.5.0 installed, yet I get

  File "/home/dev/devel/projects/buildbot/t/dustin/buildbot/test/test_status.py", line 1041, in ?
    class MyContact(words.Contact):
exceptions.AttributeError: 'module' object has no attribute 'Contact'

Any idea what that is/should be?? I don't see that symbol here: http://twistedmatrix.com/documents/current/api/twisted.words.html

04/22/08 12:26:50 changed by nhemingway

hmm. I think I see the problem. In my (local) copy of buildbot/test/test_status.py and irc.patch, there was a change to additionally import "words" from buildbot.status. In irc-notify.patch, that seems to have been replaced by an import of words from twisted. I haven't had chance to compare the two patches for other differences, but that would seem to be the cause of dustin's issue. Was there an issue with the original irc-notify.patch that caused irc.patch to be created? Did I upload the wrong format? What should I do differently?

I'll incorporate TTimo's comment about repr into my copy and upload a new copy (in whatever format people deem to be correct)

I think TTimo's idea of customizability is probably the way forward and I think I know how to achieve notification of state changes (rather than repeated fails), but I'd like to get the basic logic in place first and treat those later.

As far as saving state between restarts, I've not dug into buildbot's twisted infrastructure yet to have any clue how to go about that - patches or hints welcome.

04/22/08 12:58:45 changed by nhemingway

Scanning the two patches, the only other difference seems to be that irc-notify.patch has added the second clause to the condition at line 714 of buildbot/status/words.py:

if message.startswith("%s:" % self.nickname) or message.startswith("%s," % self.nickname):

04/22/08 13:10:34 changed by dustin

So it sounds like you have a few tweaks you want to make, followed by a new patch? If so, please post it. You're right to use the darcs diff format, as it preserves your patch title and comments (which will eventually make it into the ChangeLog?).

04/22/08 13:57:43 changed by nhemingway

  • attachment buildbot_irc.diff added.

replacement unified diff (implements state change notification, the repr change and the second clause of the condition)

04/30/08 12:15:00 changed by slinkp

I'm running that last patch against the 0.7.7 source, seems to work nicely - thanks for this!

05/15/08 15:38:12 changed by dustin

in the dev tree as #171:buildbot_irc.patch.

05/26/08 16:45:44 changed by dustin

  • status changed from assigned to closed.
  • resolution set to fixed.

pushed to brian's tree

07/15/08 13:20:11 changed by nhemingway

  • milestone changed from undecided to 0.7.8.