[Buildbot-devel] connect two builiders in buildbot

Mo Jia life.130815 at gmail.com
Mon Apr 28 12:45:06 UTC 2014


More detailed what I had  try  :

from buildbot.status.builder import Results
def MymessageFormatter(mode, name, build, results, master_status):
    result = Results[results]

    # here the build is buildstatus
    text = list()

    text.append("STATUS: %s" % result.title())
    build_config  = GetBuildconfigFromName(name)
    build_factory =  build_config.factory

    for onestep in build_factory.steps :
        text.append(onestep.schedulerNames + ":"  + "pass")


    return {
        'body' : "\n".join(text),
        'type' : 'plain'
    }


*exceptions.AttributeError: _BuildStepFactory instance has no attribute
'schedulerNames'*

Then to study the code : I found it is a little complex ,

When BuildFactory addstep

    def addStep(self, step, **kwargs):
        if kwargs or (type(step) == type(BuildStep) and issubclass(step,
BuildStep)):
            warnings.warn(
                    "Passing a BuildStep subclass to factory.addStep is "
                    "deprecated. Please pass a BuildStep instance instead.",
                    DeprecationWarning, stacklevel=2)
            step = step(**kwargs)
        self.steps.append(interfaces.IBuildStepFactory(step))

Here is 1 quetiosn : *Why  interfaces.IBuildStepFactory(step) return a
 _BuildStepFactory *?

In interfaces.IBuildStepFactory(step)  the step  . is

trigger.Trigger(schedulerNames=['test'],
                                       waitForFinish=True,
                                       haltOnFailure=False,
                                       flunkOnFailure=True)

Trigger inherit from LoggingBuildStep , LoggingBuildStep inherit from
BuildStep and
BuildStep has method :

    def __new__(klass, *args, **kwargs):
        self = object.__new__(klass)
        self._factory = _BuildStepFactory(klass, *args, **kwargs)
        return self


So question 2 *what happend when*

All_Build.addStep(trigger.Trigger(schedulerNames=['test'],
                                       waitForFinish=True,
                                       haltOnFailure=False,
                                       flunkOnFailure=True))

After have look this , So I change to use :

    for onestep in build_factory.steps :
        text.append(str(onestep.buildStep().schedulerNames) + ":"  + "pass")

It works !


So question 3 is
*Does have a better way to get every  step name in one builder ? because
here buildStep()*

*seem to do a repeat compute step.*

question4 : *you can see  "pass" here , so how can I get the step's result *
?

question5 is :* the step is trigger.Trigger() step it will trigged a
builder , Can I ** get the trigged builder 's step name  and its build
status ?*

Hacking source  may get answer  ,  whether we have a good start docement
for how to implement buildbot ?




2014-04-28 16:28 GMT+08:00 Mo Jia <life.130815 at gmail.com>:

> Hi ,
>
>        when to deal the trigger schedulers. How can i send mai when
> the total build failed , with the body conent : not only the trigger
> step name but also what detail step in the failed trigger builder.
> (I want show what trigger failed and what step in trigger failed , And
> I don't want send two mail : 1 is for total builder , 2 is for trigger
> builder , Because when thereis many trigger builder ,it will send many
> mails)
>
> From my understand ,
>
> messageFormatter (mode, name, build, results, master_status)
>
> seem can't finish my need ?
>
> 2014-04-22 20:16 GMT+08:00 Vasily <vasslitvinov at pisem.net>:
> > My suggestion was to actually chain your triggers, like this:
> >
> > test1.addStep(...) # steps you do in test1
> > test1.addStep(trigger.Trigger(schedulerNames=['test2'],
> waitForFinish=False)
> >
> > test2.addStep(...) # test2 jobs
> > test2.addStep(trigger.Trigger(schedulerNames=['test3'],
> waitForFinish=False)
> >
> > and so on.
> >
> > Hope that helps,
> > Vasily
> >
> >
> > 2014-04-22 15:58 GMT+04:00 Mo Jia <life.130815 at gmail.com>:
> >
> >> Thank you , I try like this :
> >>
> >>
> >>
> >> c['schedulers'].append (  triggerable.Triggerable(name="test1",
> >>                             builderNames=["test1"])
> >>                        )
> >>
> >> c['schedulers'].append (  triggerable.Triggerable(name="test2",
> >>                             builderNames=["test2"])
> >>                        )
> >>
> >> c['schedulers'].append(ForceScheduler(
> >>                             name="Total_Check_Build_1",
> >>                             builderNames=["Total_Check_Build_1"]))
> >>
> >>
> >> Total_Check_Build_1.addStep(trigger.Trigger(schedulerNames=['test1'],
> >>                                        waitForFinish=True))
> >>
> >> Total_Check_Build_1.addStep(trigger.Trigger(schedulerNames=['test2'],
> >>                                        waitForFinish=True))
> >>
> >>
> >> I have a question about . When I force build Total_Check_Build_1 , it
> >> will tirgger  the test1 builder to build . But When I stop test1 ,The
> >> Total_Check_Build_1 will still go on trigger test2 .
> >> So there is no "haltOnFailure"  in trigger.Trigger ?
> >>
> >> I have not try when a trigger builder was failed  what it will do .
> >> For me , both handly stop or builder failed the triggers  should not go
> >> on.
> >>
> >> Any suggestion?
> >>
> >>
> >>
> >> 2014-04-21 20:46 GMT+08:00 Vasily <vasslitvinov at pisem.net>:
> >> > Hello,
> >> >
> >> > Looks like you need to use Trigger step to start 2nd part of your
> >> > splitted
> >> > builder from the 1st part.
> >> > That should be described in the manual.
> >> >
> >> > Thanks,
> >> > Vasily
> >> >
> >> > 21.04.2014 16:01 пользователь "Mo Jia" <life.130815 at gmail.com>
> написал:
> >> >>
> >> >> Hi everyone :
> >> >>
> >> >>       I don't want build a big builder , So splite it two many
> >> >> builders ,But how can I so something like : if one build sucess ,
> then
> >> >> I start a another build. So I can separatly build a single litte
> >> >> builders when I just want to see this builder answer and I also have
> a
> >> >> need in this situation : Need build all builders and the builder are
> >> >> interdependence.
> >> >>      The  nextBuild args in BuilderConfig  seem can't complete my
> needs
> >> >> .
> >> >>
> >> >>
> >> >>
> >> >>
> ------------------------------------------------------------------------------
> >> >> Start Your Social Network Today - Download eXo Platform
> >> >> Build your Enterprise Intranet with eXo Platform Software
> >> >> Java Based Open Source Intranet - Social, Extensible, Cloud Ready
> >> >> Get Started Now And Turn Your Intranet Into A Collaboration Platform
> >> >> http://p.sf.net/sfu/ExoPlatform
> >> >> _______________________________________________
> >> >> 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/20140428/5d604483/attachment.html>


More information about the devel mailing list