2

I have a factory that I use in several builders and I set builder specific settings via util.Property and util.Interpolate. While this works fine for repourl and branch it simply doesn't work for codebase. The following piece of code shows the source step how I would like to use it in my Buildbot configuration.

factory.addStep(
    steps.Git(repourl=util.Interpolate('git://repo_base_path/%(prop:build_repository)s', default=''),
              branch=util.Property('build_branch', default='master'),
              mode='full',
              codebase=util.Interpolate('%(prop:build_repository)s', default=''),
              method='copy', submodules=True, clobberOnFailure=True)
    )
)

Without the codebase part all worked fine. I then figured I would need to set the codebase for some cases so I added the codebase line, resulting in the following error:

[-] Configuration Errors:
[-]   error while parsing config file: sequence item 1: expected
      string, Interpolate found traceback in logfile

Does anybody know why it is not possible to set the codebase via Interpolate while it is no problem to do the same thing with repourl? Does somebody have an idea how to set the codebase for the source step to something different from '' and still not create a separate factory instance for every builder?

Any insights into this and any helpful suggestion is highly appreciated.

doshea
  • 1,567
  • 1
  • 11
  • 12
Tyrnan
  • 23
  • 3
  • I thought the `Property` and `Interpolate` classes were in the `buildbot.process.properties` package, at least they seem to be in the various versions from the last few years. How are you getting to them via `util`? – doshea May 29 '15 at 01:14
  • 1
    @doshea: It seems that steps and related stuff is now implemented as a plugin. The current documentation proposes to use `from builbot.plugins import steps, util` and then access steps via the `steps` namspace and e.g. `Properties` via util. So in this case util does not refer to `buildbot.utils` but to `buildbot.plugins.util`.Sorry that this information was missing in my question. – Tyrnan May 29 '15 at 08:17
  • No need to apologize, I should have read the latest documentation better :) Thanks for the info! – doshea Jun 01 '15 at 00:49

1 Answers1

1

I think this is a bug in Buildbot. Looking at the Buildbot 0.8.12 sources, I can see that in buildbot/steps/source/git.py, in class Git, the renderables attribute includes "codebase", which should mean that you can use Interpolate in this way. Presumably some other code is assuming it can interpret codebase as a string at the time the configuration is parsed.

In other words, as far as I can tell, you're doing something that the Git class claims to support.

It looks like the old-style Git support in buildbot/steps/source/oldsource.py doesn't support codebase being a renderable, but it doesn't look to me like you're using that. I'm not entire sure, though, because I'm not sure what steps.Git refers to.

doshea
  • 1,567
  • 1
  • 11
  • 12
  • Thank's for looking that up. I think I will file a bug report then. Btw. `steps.Git` refers to buildbot.plugins.steps and that's where the new style steps recide now (they're still accesible via `buildbot.steps.source`, but as far as I undestand they may not in the future). I wanted to vote your answer up, but I can't because I do not have enough reputation yet ... – Tyrnan May 29 '15 at 08:27