[Buildbot-devel] Sending link to specific failed buildstep

Roy S. Rapoport buildbot-devel at ols.inorganic.org
Sat Oct 21 07:29:10 UTC 2006


On Sat, Oct 14, 2006 at 01:22:13PM -0700, Brian Warner wrote:
> > We're now into the 'enhancement' phase, including the CLI tool we'd like to
> > create to be able to view status, kill builds, and forcefully restart them
> > (so we can do "restart builds on all platforms for this product," e.g.).
> 
> Take a look at the 'buildbot statuslog' command as raw material for
> interacting with the PBListener-backed remote status port. I started working
> on a 'buildbot force' command a few months ago but got distracted in the
> details of trying to make it use the same sort of command mechanism as
> 'buildbot try'. 'buildbot kill' should probably use the same code.

I did, and ... well, I'm sure that would be the more elegant way to do
this, but we chose differently.  Specifically, what I did was:
A) I created a new HTML status display that displays each builder as XML.
Here, for example, is the display of one builder:

<builder>
 <name>
  foo head freebsd-4.11-i386-0
 </name>
 <status>
  building
 </status>
 <text>
  build
 </text>
 <results>
  failure
 </results>
 <current_build_url>
  http://bbot:8010/foo%20head%20freebsd-4.11-i386-0/builds/70
 </current_build_url>
 <current_build_steps>
  <step>
   <name>
    build
   </name>
   <url>
    http://bbot:8010/foo%20head%20freebsd-4.11-i386-0/builds/70/step-build
   </url>
   <logs>
    <stdio>
     http://bbot:8010/foo%20head%20freebsd-4.11-i386-0/builds/70/step-build/0
    </stdio>
   </logs>
  </step>
 </current_build_steps>
 <builder_url>
  http://bbot:8010/foo%20head%20freebsd-4.11-i386-0
 </builder_url>
 <last_build_url>
  http://bbot:8010/foo%20head%20freebsd-4.11-i386-0/builds/69
 </last_build_url>
 <previous_build_steps>
  <step>
   <name>
    build
   </name>
   <url>
    http://bbot:8010/foo%20head%20freebsd-4.11-i386-0/builds/69/step-build
   </url>
   <text>
    build failed
   </text>
   <logs>
    <stdio>
     http://bbot:8010/foo%20head%20freebsd-4.11-i386-0/builds/69/step-build/0
    </stdio>
    <interrupt>
     http://bbot:8010/foo%20head%20freebsd-4.11-i386-0/builds/69/step-build/1
    </interrupt>
   </logs>
  </step>
 </previous_build_steps>
</builder>

I then have my command-line program grab the page, parse it appropriately (so a
builder class gets that xml tree and creates its worldview), and lets me do
things like, e.g. 

# show status of building foo on freebsd-4.11
bcontrol --product foo --platform freebsd-4.11

# stop current build
bcontrol --product foo --platform freebsd-4.11 --stop --reason "because"

# start a new one
bcontrol --product foo --platform freebsd-4.11 --force --reason "I feel like it"

It works quite well for us so far.

-roy




More information about the devel mailing list