[Buildbot-devel] gerrit integration

Nicolas Bock nicolasbock at gmail.com
Tue Mar 31 17:35:15 UTC 2015


Hi,

I can't quite reproduce the error I thought I was getting. I rebased a
change-set in gerrit to trigger a buildbot build, and got a python
exception. I am running the latest buildbot I installed with pip. The
twistd.log output is included below:

I have also pasted the master.cfg lines just in case I mistyped or
omitted something in my original email

##############

c['schedulers'].append(AnyBranchScheduler(
    name="gerrit",
    change_filter=GerritChangeFilter(branch_re="master.*",
                                     project="PROJ",
                                     eventtype="patchset-created"),
    treeStableTimer=15*60,
    builderNames=[
        "gerrit-release-gcc-4.7.4"
    ]))

from buildbot.steps.source.gerrit import Gerrit
gerrit_factory = BuildFactory()
gerrit_factory.addStep(Gerrit(repourl="ssh://HOST:29418/REPO.git"))

c['builders'].append(
    BuilderConfig(name="gerrit-release-gcc-4.7.4",
                  slavenames=slave_list,
                  factory=gerrit_factory,
                  env={"FC": "/usr/local/gcc-4.7.4/bin/gfortran",
                       "CC": "/usr/local/gcc-4.7.4/bin/gcc",
                       "BUILD_TYPE": "Release"}))

##################

2015-03-31 11:24:55-0600 [-] gerrit:
{"type":"patchset-created","change":{"project":"PROJ","branch":"master","topic":"cleanup","id":"Ibb94c910e5b0620ab4938a6e5c41c367d7eda79d","number":"358","subject":"Merge
common_units.inc with common_units.F90.","owner":{"name":"Nicolas
Bock","email":"nbock","username":"nbock"},"url":"http://HOST/gerrit/358","commitMessage":"Merge
common_units.inc with common_units.F90.\n\nMake the code more
Fortranish...\n\nChange-Id:
Ibb94c910e5b0620ab4938a6e5c41c367d7eda79d","status":"NEW"},"patchSet":{"number":"11","revision":"1401d3a5da300cca13ed1ea779821691170bfb80","parents":["9bc7e7dc90bd64786458b0f8d2aafc74a87be596"],"ref":"refs/changes/58/358/11","uploader":{"name":"Nicolas
Bock","email":"nbock","username":"nbock"},"createdOn":1427822694,"author":{"name":"Nicolas
Bock","email":"nbock","username":"nbock"},"isDraft":false,"kind":"TRIVIAL_REBASE","sizeInsertions":255,"sizeDeletions":-247},"uploader":{"name":"Nicolas
Bock","email":"nbock","username":"nbock"}}
2015-03-31 11:24:55-0600 [-] added change
Change(revision=u'1401d3a5da300cca13ed1ea779821691170bfb80',
who=u'Nicolas Bock <nbock>', branch=u'master/358', comments=u'Merge
common_units.inc with common_units.F90.', when=1427822695,
category=u'patchset-created', project=u'PROJ',
repository=u'ssh://buildbot@HOST:29418/REPO', codebase=u'') to
database
2015-03-31 11:24:55-0600 [-] while invoking callback <function
changeCallback at 0x4200b18> to <SubscriptionPoint 'changes'>
        Traceback (most recent call last):
          File "/home/buildbot/env/local/lib/python2.7/site-packages/twisted/internet/defer.py",
line 383, in callback
            self._startRunCallbacks(result)
          File "/home/buildbot/env/local/lib/python2.7/site-packages/twisted/internet/defer.py",
line 491, in _startRunCallbacks
            self._runCallbacks()
          File "/home/buildbot/env/local/lib/python2.7/site-packages/twisted/internet/defer.py",
line 578, in _runCallbacks
            current.result = callback(current.result, *args, **kw)
          File "/home/buildbot/env/local/lib/python2.7/site-packages/buildbot/master.py",
line 513, in notify
            self._change_subs.deliver(change)
        --- <exception caught here> ---
          File "/home/buildbot/env/local/lib/python2.7/site-packages/buildbot/util/subscription.py",
line 37, in deliver
            sub.callback(*args, **kwargs)
          File "/home/buildbot/env/local/lib/python2.7/site-packages/buildbot/schedulers/base.py",
line 175, in changeCallback
            if change_filter and not change_filter.filter_change(change):
          File "/home/buildbot/env/local/lib/python2.7/site-packages/buildbot/changes/filter.py",
line 86, in filter_change
            chg_val = change.properties.get(chg_attr.split(":", 1)[1], '')
        exceptions.AttributeError: Properties instance has no attribute 'get'

On Tue, Mar 31, 2015 at 8:00 AM, Mikhail Sobolev <mss at mawhrin.net> wrote:
> Hi Nicolas,
>
> On Tue, Mar 31, 2015 at 06:36:47AM -0600, Nicolas Bock wrote:
>> I can't seem to figure out how to integrate buildbot with gerrit. In
>> master.cfg I have:
>>
>> c['change_source'].append(GerritChangeSource("host", "some_name"))
>> c['schedulers'].append(AnyBranchScheduler(name="gerrit",
>>   change_filter=GerritChangeFilter(eventtype="patchset-created"))
>> factory.addStep(Gerrit(repourl="URL"))
> This looks correct.
>
>> The build is triggered correctly, but the git command (from Gerrit())
>> is not fetching the commit properly.
> Do you think you could provide a log for the failed step?
>
> --
> Misha
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel




More information about the devel mailing list