[users at bb.net] Using Buildbot addChange
honas grael
honasgraeymael at gmail.com
Fri Oct 11 18:10:22 UTC 2019
Hello. I thought I should update with what I've tried so far.
In my master.cfg i've added the following def get_change_list() method
from buildbot.plugins import *
from buildbot.plugins import steps, util
c = BuildmasterConfig = {}
####### WORKERS
c['workers'] = [worker.Worker("example-worker", "pass")]
c['protocols'] = {'pb': {'port': 9989}}
####### CHANGESOURCES
c['change_source'] = []
c['change_source'].append(changes.GitPoller(
'git://<GIT URL>',
workdir='gitpoller-workdir', branch='bugfix',
pollInterval=300))
####### SCHEDULERS
c['schedulers'] = []
c['schedulers'].append(schedulers.SingleBranchScheduler(
name="all",
change_filter=util.ChangeFilter(branch='bugfix'),
treeStableTimer=None,
builderNames=["runtests"]))
c['schedulers'].append(schedulers.ForceScheduler(
name="force",
builderNames=["runtests"]))
####### BUILDERS
factory = util.BuildFactory()
factory.addStep(steps.Git(repourl='git://<GIT URL>', mode='incremental'))
factory.addStep(steps.ShellCommand(command=["trial", "hello"],
env={"PYTHONPATH": "."}))
c['builders'] = []
f_simplebuild = util.BuildFactory()
*@defer.inlineCallbacksdef get_change_list()yield
self.master.data.updates.addChange( author='joe bloggs',
committer='jack bloggs', revision='revision
101', files='file_a.txt', comments='here are
the changes', when_timestamp=date.datime.now()
branch='my_local_branch', category='no category info',
project='my_local_project', repository='dev repo
1', src='Synergy')*
#This will be the comman
c['builders'].append(
util.BuilderConfig(name="runtests",
workernames=["example-worker"],
factory=f_simplebuild))
####### BUILDBOT SERVICES
c['services'] = []
####### PROJECT IDENTITY
c['title'] = "BUILD BOT"
c['titleURL'] = "https://buildbot.github.io/hello-world/"
c['buildbotURL'] = "http://localhost:8010/"
# minimalistic config to activate new web UI
c['www'] = dict(port=8010,
plugins=dict(waterfall_view={}, console_view={},
grid_view={}))
####### DB URL
c['db'] = {
'db_url' : "sqlite:///state.sqlite",
}
I got some of this from hgPoller
<https://github.com/buildbot/buildbot/blob/7658c965b3bedb3e5532446e1352f62fe7c102ab/master/buildbot/changes/hgpoller.py#L1>.
My question is how do I call def get_change_list() so that it can update
the Changes for the specific build?
Any suggestions.
Am I going about this all wrong?
Please help
On Wed, Oct 9, 2019 at 7:09 PM honas grael <honasgraeymael at gmail.com> wrote:
> *Hello**I am using an uncommon VCS, so not one of the popular ones like
> Git or Mercurial.**When I do a build I get a text file with all the
> changes in the baseline that I am building.**I want to use this list of
> changes to populate the Change tab*
> [image: Screenshot from 2019-10-09 19:02:20.png]
>
> To that end I want to use the addChange
> <https://docs.buildbot.net/latest/developer/rest.html?highlight=addchanges#change>
> api call for each entry in the file that I have, so I can have a list of
> changes for the buildrequest
> addChange(*files=None*, *comments=None*, *author=None*, *revision=None*,
> *when_timestamp=None*, *branch=None*, *category=None*, *revlink=''*,
> *properties={}*, *repository=''*, *codebase=None*, *project=''*,
> *src=None*)
> <https://docs.buildbot.net/latest/developer/rest.html?highlight=addchanges#buildbot.data.changes.Change.addChange>
> I am not clear how to call this method so that I can pass in the contents
> of the file that my VCS gives me.
> Do I need to add a util.renderer decorated function to my master.cfg?
> Can I use an external python file to add the changes to a specific
> build-request?
> Does anyone have an example of how I might make use of this API call?
>
> I could really use the help.Thanks
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/users/attachments/20191011/56969996/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot from 2019-10-09 19:02:20.png
Type: image/png
Size: 39852 bytes
Desc: not available
URL: <http://lists.buildbot.net/pipermail/users/attachments/20191011/56969996/attachment.png>
More information about the users
mailing list