[users at bb.net] Query related to getting buildbot object instance

Nilay Chheda mit2nil at gmail.com
Mon Jun 20 23:19:28 UTC 2016


Hi Pierre,

Thanks for the reply. I later on found out that I can skip the subject
field from MailNotifier and send it as a key-value pair of messageFormatter
field dictionary,

I replaced below code:

c["status"].append(MailNotifier(
    builders=["CRT_Promoter_2"],
    fromaddr="nilay at localhost",
    sendToInterestedUsers=False,
    mode="passing",
    extraRecipients=email_recipients,
*  subject="CRT Promotion notification"*
    messageFormatter=crt_promoter_message_formatter))

def def crt_promoter_message_formatter(mode, name, build, results,
master_status):
    text = list()
    ...
    # update list with email body
    ....
    return {'body': u"\n".join(text),
                'type': 'html'}

with ...

c["status"].append(MailNotifier(
    builders=["CRT_Promoter_2"],
    fromaddr="nilay at localhost",
    sendToInterestedUsers=False,
    mode="passing",
    extraRecipients=email_recipients,
  *#**subject="CRT Promotion notification"*
    messageFormatter=crt_promoter_message_formatter))

def def crt_promoter_message_formatter(mode, name, build, results,
master_status):
    text = list()
    ...
    # update list with email body
    ....
    return *{'subject':"CRT Promotion notification, CRT
Tag:{}".format(build.getProperty('tag','')),*
                'body': u"\n".join(text),
                'type': 'html'}




On Tue, Jun 14, 2016 at 1:29 AM, Pierre Tardy <tardyp at gmail.com> wrote:

> Hi Nilay,
>
> I am not sure exactly what is your request.
>
> Usually, when you need customization that is not possible by just
> configuring the buildbot object, you might want to just subclass that
> object.
> In this case, you would  mailnotifier do not have much option to customize
> the subject of the email, so you would have to subclass it.
>
> Please note that such subclassing might not be portable with subsequent
> buildbot releases.
> Notably buildbot nine mailnotifier has changed a lot, so you will need to
> rewrite your subclassing code when you upgrade
>
> Regards
> Pierre
>
>
> Le mar. 14 juin 2016 à 03:20, Nilay Chheda <mit2nil at gmail.com> a écrit :
>
>> Hi,
>>
>> I am new to buildbot community. I am working on some existing buildbot
>> code for one project. Code mainly contains few builders/schedulers/status
>> notifier etc. in BuilderConfig dict.
>>
>> I want to send custom mail notification with certain build properties in
>> the mail subject itself. In mail body I have build object instance coming
>> as a parameter. How can I get custom build object in my master.cfg file
>> itself?
>>
>> I went through several files on buildbot github and tried to search in
>> buildbot documentation but not able to figure out way to do it.
>>
>> I am using buildbot 0.8.12. Thanks for your help.
>>
>> --
>> Regards,
>> *Nilay Chheda*
>>
>> _______________________________________________
>> users mailing list
>> users at buildbot.net
>> https://lists.buildbot.net/mailman/listinfo/users
>
>


-- 
Regards,
*Nilay Chheda*
nilay.branded.me
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/users/attachments/20160620/1d2fa63c/attachment.html>


More information about the users mailing list