BUILDBOT: ¿Cómo saber la twig que desencadenó la construcción?

Intento configurar buildbot para múltiples proyectos, git repositories y git branches.

Para cada uno, agregué un GitPoller con branches=[master, develop, release] . Es un trabajo, pero no sé lo que tengo que poner en los steps.Git . Argumento de la branch steps.Git . ¿Cómo saber la twig que desencadenó la construcción?

ver la function generic_factory(package) (13ª línea)

 def add_git_poller(c, package, pollinterval=-2): name = package.get_uid() build_data = package.get_build_data() # get branches try: branches = build_data['branches'] except KeyError: branches = ['master'] workdir = os.path.join("gitpoller",util.safeTranslate(name)) dwlogging.info("Add git poller '%s' (workdir=%s, project=%s, branches=%s, pollinterval=%i)" % (name, workdir, name, branches, pollinterval)) poller = plugins.changes.GitPoller(repourl=package.get_cvs_url(), project=name, workdir=workdir, branches=branches, pollinterval=pollinterval) c['change_source'].append(poller) def schedule_single_branch(c, package): name = package.get_uid() build_data = package.get_build_data() # get branches if 'branches' in build_data: branches = build_data['branches'] else: branches = ['master'] for branch in branches: s_name="%s_%s" % (branch, name) builders=[name] dwlogging.info("Add single branch scheduler '%s' (project=%s, branch=%s, builders=%s)" % (s_name, name, branch, str(builders))) change_filter = plugins.util.ChangeFilter(branch=branch, project=name) scheduler = plugins.schedulers.SingleBranchScheduler( name=s_name, change_filter=change_filter, builderNames=builders) c['schedulers'].append(scheduler) # ... def add_builder(c, package): name = package.get_uid() dwlogging.trace("add builder for package %s" % name) available_slaves = slaves_config.keys() build_data = package.get_build_data() slavenames = build_data['slaves'] for slavename in slavenames: if slavename not in available_slaves: raise Exception("Package '%s' : slave '%s' not exists" % (name, slavename)) if len(slavenames) > 0: builddir = os.path.join("build",util.safeTranslate(name)) tags = [package.get_repository().get_uid()] dwlogging.info("Add builder '%s' (builddir=%s, slaves=%s)" % (name, builddir, str(slavenames))) f = generic_factory(package) builder_config = plugins.util.BuilderConfig( name=name, builddir=builddir, slavenames=slavenames, factory=f, tags=tags) c['builders'].append(builder_config) def generic_factory(package): name = package.get_uid() dwlogging.info("Make build factory for '%s' package" % name) build_data = package.get_build_data() testdir = os.path.join("test",util.safeTranslate(name)) factory = plugins.util.BuildFactory() # check out the source if build_data['cvs']['type'] == 'git': submodules = build_data['cvs'].get('submodules',False) dwlogging.info("Add git step (submodules=%s)" % str(submodules)) factory.addStep(plugins.steps.Git(repourl=package.get_cvs_url(), mode='full', submodules=submodules, branch='%%BRANCH%%')) # ??? else: dwlogging.error("%s not implemented yet" % build_data['cvs']['type']) if 'steps' in build_data and build_data['steps']: for step_data in build_data['steps']: step_type = step_data.get('type') step_args = step_data.get('args') if not isinstance(step_args, (list, tuple)): step_args = [step_args] workdir = step_data.get('workdir', None) dwlogging.info("Add step %s (%s workdir:%s)" % (step_type, step_args, workdir)) if step_type == 'command': factory.addStep(plugins.steps.ShellCommand(name="command (%s)" % step_args[0], command=step_args, workdir=workdir)) elif step_type == 'compile': factory.addStep(plugins.steps.Compile(command=step_args, warningPattern="^(.\*?):([0-9]+): [Ww]arning: (.\*)$", warningExtractor=plugins.steps.Compile.warnExtractFromRegexpGroups, workdir=workdir)) elif step_type == 'pyflakes': command = ["pyflakes"] + step_args factory.addStep(plugins.steps.PyFlakes(command=command)) elif step_type == 'pylint': for path in step_args: factory.addStep(plugins.steps.PyLint(name="pylint (%s)" % path, command=["pylint", path])) elif step_type == 'trial': for path in step_args: factory.addStep(plugins.steps.Trial(name="trial (%s)" % path, tests=path, testpath="python")) elif step_type == 'mkdir': factory.addStep(plugins.steps.MakeDirectory(dir=step_args[0])) factory.addStep(plugins.steps.RemovePYCs()) return factory for package_uid in packages: package = pkg_manager.get_package(package_uid) add_git_poller(c, package, pollinterval=300) schedule_single_branch(c, package) schedule_forced(c, package) schedule_try(c, package, schedule_try_port, [('sampleuser','samplepass')]) schedule_try_port += 1 add_builder(c, package) 

La documentation de Buildbot para el paso de Git dice:

twig

(opcional): esto especifica el nombre de la twig que se utilizará cuando una compilation no proporcione una propia. Si este parámetro no se especifica y Build no proporciona una bifurcación, se usará la twig principal.

lo cual interpreto que significa que el paso de Git por defecto 'henetworkinga' la twig cuyo cambio desencadenó la compilation. Por lo tanto, si solo dejas ese parámetro solo, probablemente debería funcionar.