[Buildbot-devel] more flexible Change class?

Robert Helmer rhelmer at mozilla.com
Wed Dec 6 22:37:55 UTC 2006


Hey,

I am working on making a new type of change object (based on bhearsum's 
bonsaipoller.py) which parses this page:
http://tinderbox.mozilla.org/showbuilds.cgi?tree=Firefox&quickparse=1

I am using it to kick off a series of steps which download the latest 
build and test it.

It works fine for my needs right now, but I am noticing that Change is 
very heavily biased towards revision control changes and not "change" in 
the more generic sense (which the name of the object might lead you to 
believe).

For example, instead of returning who, files, comments, and when it'd 
make more sense for my object to return hostname, status and when. These 
map OK I guess, but would it be desirable to have the change object be 
more generic?

Instead of:

c = changes.Change(who = buildNode['hostname'], files = '', comments = 
buildNode['status'], when = int(buildNode['date']))

Maybe Change could take a dict like:

{'hostname': buildNode['hostname'], 'status':buildNode['status']}

And the "/changes" page would just lay it out like:

--
hostname:
  example-hostname

status:
  success
--

Maybe "who" and "when" would be required, and "files" supported. It'd be 
nice if the html page would lay out a random dict or list like :

{'data': ['1','2','3']}
 
would be:

data:
 * 1
 * 2
 * 3

I think it might make sense to refactor the common parts of the VCS 
change objects to a subclass of Change, since it seems like (at a 
glance) that they have a lot in common, and it might make supporting new 
systems even easier.

Anyway, not sure if anyone else is interesting in using Buildbot to take 
changes from things that aren't version control systems, but if so 
this'd help me :) Brian, I can put together a patch if this is something 
you'd be interested in. I think it'd be a way of solving the CVS 
revision number silliness we did in the bonsaipoller.py with sticking 
the revision in with the filename.


Thanks,
Rob




More information about the devel mailing list