0

Writing my first custom class for Buildbot.

I am subclassing ShellCommand; the class will have to - Run scripts (written in shell script or Python) - Be able to retrieve logs and parse them - retrieve data from the builders and change sources, to populate reports.

So far I made a basic one that is able to run a script; but I am facing 2 big issues:

1) When I run many steps; I am not sure how do I differentiate among them in the mail notifier function. If I have 5 steps and the 3rd fail; the example that is on the Buildbot site will grab only the last commit logs, not the one that fail; and I am not sure how you actually grab a specific log from a specific step. The docs won't help at all, but I am sure that there is a way to say in the mail notifier function

"grab this log called 'errors' from the step called 'unit test' "

Altho I have no clue how to do that. I imagine that the same should work if I try to get these info from my custom class, and not only in the mail notifier.

2) I want to get info about what I build, to generate reports and eventually mail. The issue is that I have no idea how to get data. From my class, ideally I would grab things like revision for a specific project; person that did the commit, time of the commit; builder and so on. So far I have found nothing that tell me how to get these values.

I am experimenting with the buildbot.status.builder Results; but I have no clue if that is the right class to look at; I just wish that there was something simple to call; that would return info, but the manual is more interested in explaining how to set up a buildbot; with all the features that are already in their class; instead than also pointing you at how to do your own (the customization section is quite short and has no real description of cases like mine).

Any help or example would be more than appreciated; so far I have found nothing relevant on Google, except few classes that require me weeks just to decipher what is going on there. Thanks

1 Answers1

0

I cannot help you with issue 1 About issue 2 I'd suggest having a look to build properties (to retrieve the info) and createSummary function. You have a createSummary example here

In case of more doubts or problems I suggest writing to builbot mailing list as there isn't much support here in SO

hithwen
  • 2,154
  • 28
  • 46
  • Thanks; I didn't even try on the mailing list since I heard that there is sporadic help; so I tried directly here (to have more eyes on it). I have used the example for createSummary, I will check properties, altho from what I understand, they are more of a way to change the build parameters,instead than getting data from the various components of the buildbot. There should be in Buildbot, a feature that saves every info on a dictionary or DB, and a class that is able to access them by name, build number or step name....Not sure how others write reports, without any example available:) Thanks! –  May 12 '14 at 19:43
  • So for #1, there is no way to get logs for a specific step, once you are in the createSummary? You can only retrieve the latest one (most recent), as in the example on the manual? Thanks! –  May 12 '14 at 19:44
  • 1
    You can retrieve all of them (each at it's own time), but I don't know if there's an easy way to glue them together, you'll probably have to program it yourself. For example, you can go and keep filling a build property on every step and then in the last step process it's contents – hithwen May 13 '14 at 07:04
  • Make sense; I was planning to write the code to paste all, but was hoping that it exist already. Thanks! –  May 13 '14 at 07:59