Opened 3 years ago

Last modified 3 years ago

#3303 new defect

Docs: factory workdir incorrect

Reported by: daemacles Owned by:
Priority: major Milestone: undecided
Version: 0.8.12 Keywords: docs
Cc:

Description (last modified by sa2ajj)

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'>): []

Change History (2)

comment:1 follow-up: Changed 3 years ago by sa2ajj

  • Description modified (diff)

comment:2 in reply to: ↑ 1 Changed 3 years ago by daemacles

Replying to sa2ajj:

Thanks for the help with markup =)

Note: See TracTickets for help on using tickets.