[Buildbot] #3303: Docs: factory workdir incorrect

Buildbot trac trac at buildbot.net
Wed Jul 8 04:46:46 UTC 2015


#3303: Docs: factory workdir incorrect
----------------------+------------------------
Reporter:  daemacles  |       Owner:
    Type:  defect     |      Status:  new
Priority:  major      |   Milestone:  undecided
 Version:  0.8.12     |  Resolution:
Keywords:  docs       |
----------------------+------------------------
Description changed by sa2ajj:

Old description:

> From http://docs.buildbot.net/current/manual/customization.html#factory-
> workdir-functions
>
> "... That callable will be invoked with the SourceStamp for the build
> ..."
>
> But actually the callable is invoked with a list of SourceStamps. Is it
> possible to update the docs with the correct calling format for the
> workdir callable?
>
> Sorry, I'm new to BuildBot and so am not familiar enough with the
> codebase to understand where/why this is happening.
>
> Reproduce:
>
> (in master.cfg)
> ------------------------
> def workdir(source_stamp):
>     log.msg('!!!!!!!!! SOURCE_STAMP {}'.format(source_stamp))
>     return "{}-{}".format(source_stamp.repository, source_stamp.branch)
>
> repo_test_factory = util.BuildFactory()
> repo_test_factory.workdir = workdir
> ...
> c['builders'] = [test_repo_builder]
> ...
> ------------------------
>
> This fails with the error:
>
> 2015-07-07 23:06:27-0400 [Broker,1,127.0.0.1] ping finished: success
> 2015-07-07 23:06:27-0400 [-] <Build test_repo_build>.startBuild
> 2015-07-07 23:06:27-0400 [-] !!!!!!!!! SOURCE_STAMP
> [<buildbot.sourcestamp.SourceStamp instance at 0x7f8d8d57efc8>]
> 2015-07-07 23:06:27-0400 [-] Build.setupBuild failed
> 2015-07-07 23:06:27-0400 [-] Unhandled Error
>         Traceback (most recent call last):
>           File "/usr/local/lib/python2.7/dist-
> packages/twisted/internet/defer.py", line 1184, in gotResult
>             _inlineCallbacks(r, g, deferred)
>           File "/usr/local/lib/python2.7/dist-
> packages/twisted/internet/defer.py", line 1128, in _inlineCallbacks
>             result = g.send(result)
>           File "/usr/local/lib/python2.7/dist-
> packages/buildbot/process/builder.py", line 425, in _startBuildFor
>             bs, self.expectations, slavebuilder)
>           File "/usr/local/lib/python2.7/dist-
> packages/twisted/internet/defer.py", line 150, in maybeDeferred
>             result = f(*args, **kw)
>         --- <exception caught here> ---
>           File "/usr/local/lib/python2.7/dist-
> packages/buildbot/process/build.py", line 260, in startBuild
>             self.setupBuild(expectations)  # create .steps
>           File "/usr/local/lib/python2.7/dist-
> packages/buildbot/process/build.py", line 326, in setupBuild
>             step.setDefaultWorkdir(self.workdir(self.sources))
>           File "/home/wibotic_ci/master/master.cfg", line 70, in workdir
>             ss.write('{}\n\n'.format(source_stamp))
>         exceptions.AttributeError: 'list' object has no attribute
> 'repository'
>
> 2015-07-07 23:06:27-0400 [-] releaseLocks(<BuildSlave 'local-slave'>): []

New description:

 From http://docs.buildbot.net/current/manual/customization.html#factory-
 workdir-functions

 "... That callable will be invoked with the `SourceStamp` for the build
 ..."

 But actually the callable is invoked with a list of `SourceStamps`. Is it
 possible to update the docs with the correct calling format for the
 `workdir` callable?

 Sorry, I'm new to Buildbot and so am not familiar enough with the codebase
 to understand where/why this is happening.

 Reproduce:

 (in master.cfg)
 {{{
 def workdir(source_stamp):
     log.msg('!!!!!!!!! SOURCE_STAMP {}'.format(source_stamp))
     return "{}-{}".format(source_stamp.repository, source_stamp.branch)

 repo_test_factory = util.BuildFactory()
 repo_test_factory.workdir = workdir
 ...
 c['builders'] = [test_repo_builder]
 ...
 }}}

 This fails with the error:

 {{{
 2015-07-07 23:06:27-0400 [Broker,1,127.0.0.1] ping finished: success
 2015-07-07 23:06:27-0400 [-] <Build test_repo_build>.startBuild
 2015-07-07 23:06:27-0400 [-] !!!!!!!!! SOURCE_STAMP
 [<buildbot.sourcestamp.SourceStamp instance at 0x7f8d8d57efc8>]
 2015-07-07 23:06:27-0400 [-] Build.setupBuild failed
 2015-07-07 23:06:27-0400 [-] Unhandled Error
         Traceback (most recent call last):
           File "/usr/local/lib/python2.7/dist-
 packages/twisted/internet/defer.py", line 1184, in gotResult
             _inlineCallbacks(r, g, deferred)
           File "/usr/local/lib/python2.7/dist-
 packages/twisted/internet/defer.py", line 1128, in _inlineCallbacks
             result = g.send(result)
           File "/usr/local/lib/python2.7/dist-
 packages/buildbot/process/builder.py", line 425, in _startBuildFor
             bs, self.expectations, slavebuilder)
           File "/usr/local/lib/python2.7/dist-
 packages/twisted/internet/defer.py", line 150, in maybeDeferred
             result = f(*args, **kw)
         --- <exception caught here> ---
           File "/usr/local/lib/python2.7/dist-
 packages/buildbot/process/build.py", line 260, in startBuild
             self.setupBuild(expectations)  # create .steps
           File "/usr/local/lib/python2.7/dist-
 packages/buildbot/process/build.py", line 326, in setupBuild
             step.setDefaultWorkdir(self.workdir(self.sources))
           File "/home/wibotic_ci/master/master.cfg", line 70, in workdir
             ss.write('{}\n\n'.format(source_stamp))
         exceptions.AttributeError: 'list' object has no attribute
 'repository'

 2015-07-07 23:06:27-0400 [-] releaseLocks(<BuildSlave 'local-slave'>): []
 }}}

--

--
Ticket URL: <http://trac.buildbot.net/ticket/3303#comment:1>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the bugs mailing list