[Buildbot-devel] Adding a Changelist to Buildbot Notification emails

Ian Peters-Campbell mahatmamanic at gmail.com
Mon Apr 20 13:52:03 UTC 2009


Hey Chris,

I am not sure whether there is a built-in functionality for that.  I kind of
hope not, since i took the time to write my own custom bit of code for it.
I wrote a script to compile and print a list of changes from a range of
revision numbers, then wrapped that in another bit which pickled out a
mapping of build numbers to builders.  Then in the MailNotifier code, if a
build was successful I added a hook to call in, get the diff of svn numbers,
and return the list of change notes which are then pasted into the email.
My clever engineers have now started adding the bugzilla url for addressed
issues directly to their svn change-notes, so that bug links appear in the
mail.

Note that (at least with 0.7.9) to get this to work I also had to enable the
successful build case.  In the existing code base it recognized failing
builds and all builds, but would assert out on the successful builds only
case.

Regarding the properties you are asking about, you should be able to get
them out of the builder's properties, which is available from the
MailNotifier if you are overriding code there.  The only one I am not sure
about is the person who ordered the build.  If you are ordering the builds
through IRC it should be fairly easy to get the handle of whoever sent the
build request to the Bot, though of course that's not really any guarantee
unless you enforce a strict nickserv policy.  If you are ordering builds
through the web interface I am less familiar with that.

For your other idea, running the build through a scheduler, it seems like
the easiest, shortcut way to manually force a scheduler to fire off at will
would be to add a dummy file to the tree (say "buildMe.txt.") and just check
it in when you want your builder to fire off.  I'd personally prefer using
the IRC interface, but I don't see why that wouldn't work.  I am not sure
how to retrievethe "last successful" build in this case.

It seems though that if you already have the code to generate the changelist
given 2 svn revisions as bounds, you've got a lot of the work for the
solution I used already done.  If, at the simplest, you create a dict of
builder names -> last succesful build numbers which gets pickled in/out on
requests/changes, and leverage that with your changelist generating code,
you should be able to make a couple simple changes to MailNotifier to get
the behavior you want.

Let me know if any of that doesn't make sense...it's 630 in the morning, so
it's completely possible that I am writing sanskrit without realizing it.

Ian


On Mon, Apr 20, 2009 at 3:58 AM, Chris Kwan <chriswkwan at gmail.com> wrote:

> Dear Buildbot Community,
>
> I would like to modify the buildbot mail notifier to be able to append a
> changelist to the build notification email that gets sent when a build
> completes.  The changelist is to be a report of the changes between the
> current build and the last successful built.
>
> We have a tool that can generate a changelist report given two changelist
> numbers, the problem we are running into is how to retrieve these two
> numbers because for our build configuration, there is not really a concept
> of a last build.  In this build configuration, we have to force the build
> manually with the click of a button on our web interface, and when forcing
> the build, you can specify any revision number to build from (and thus you
> could choose an older revision number).
>
>
>    - Is there a way to keep track of the latest last known good build
>    revision number?  For example, our web page would have a form that looked
>    like the following:
>    - Also, do you know where the following parameters (name, reason,
>    branch, revision) get passed to in case we would want to catch them for
>    error checking?
>
> =====
> Your name:
> Reason for build:
> Branch to build:
> Revision to build:
>
> Last known good build, which is build #67 was at changelist 4910.
> Generate changelist report starting from [4910] (with [4910] being in a
> text box that you could change if you wanted to start the report from an
> older build)
> =====
>
> Another idea is to have our build run by a scheduler, so that a new build
> is built every night.  Since the scheduler is always building a new build,
> it will know the last successful build that it built.
>
>    - Is there a way that we can trigger the scheduler on demand through
>    the web interface?
>
>
>    - And if so, how can we retrieve the the current revision number and
>    last revision number that the scheduler has built?
>
>
> Any help or suggestions would be much appreciated.
>
> Thank you,
> Christopher
>
>
> ------------------------------------------------------------------------------
> Stay on top of everything new and different, both inside and
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today.
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20090420/f23cc861/attachment.html>


More information about the devel mailing list