[Buildbot-devel] Sending link to specific failed buildstep

Brian Warner warner-buildbot at lothar.com
Sun Oct 15 17:50:45 UTC 2006


"Roy S. Rapoport" <buildbot-devel at ols.inorganic.org> writes:

> This worked pretty well.  I had to change builder.FAILURE to FAILURE (we
> import FAILURE by name, rather than importing builder) and change getURLFor
> to getURLForThing.  

Oops, right. buildbot/interfaces.py had the wrong function name in it.. I'll
fix that.

> Ideally, I'd love to include the link to the stdio log, rather than the
> build step -- I could cheat by just appending '/0', but is there a better
> way to do that?

Yes, use the same procedure. IBuildStepStatus provides a 'getLogs()' method
(around interfaces.py:481) that returns a list of objects which implement
IStatusLog. Each of these implements getName() (line 599) and getText(). Take
a look at the clause in buildbot/status/mail.py that loops through
build.getLogs() and pulls the name and text out of each out: you can do
exactly the same for the step's logs. (the build's logs are just the union of
the logs of all of its steps).

There's nothing written in stone that says the main log will be named "stdio"
(it used to be named "stdout", and really "stdout+stderr" would be more
accurate but too long).. you might consider providing links to all the logs
in case there is none named "stdio". But you might also just not worry about
it until/unless something changes.

for log in step.getLogs():
    if log.getName() == "stdio":
        logurl = status.getURLForThing(log)
        text += "stdio: %s\n" % logurl
        break


cheers,
 -Brian




More information about the devel mailing list