From xuoguoto at protonmail.com Sat Sep 2 05:24:53 2023 From: xuoguoto at protonmail.com (Xuo Guoto) Date: Sat, 02 Sep 2023 05:24:53 +0000 Subject: [users@bb.net] GerritChangeSource is not triggering a build Message-ID: Hello all, New user of BB trying to configure BB with Gerrit here. tl;dr Using docs/examples/git_gerrit.cfg as a guide, tried to configure BB with Gerrit, but GerritChangeSource is not showing any events, nor triggering the build. Longer version: I have setup BB with a sample repository with an one line build step which just says echo as in: factory = util.BuildFactory() factory.addStep(steps.Gerrit(repourl=gerrit_repo, mode="full",retry=[60,60],timeout=3600)) factory.addStep(steps.ShellCommand(command=["echo", "hello"], env={"PYTHONPATH": "."})) c['builders'] = [] c['builders'].append( util.BuilderConfig(name="runtests", workernames=["example-worker"], factory=factory)) I have two schedules defined: c['schedulers'] = [] c['schedulers'].append(schedulers.SingleBranchScheduler( name="all", change_filter=util.ChangeFilter(branch='master', filter_fn=change_code_review_plus_2), treeStableTimer=None, builderNames=["runtests"])) c['schedulers'].append(schedulers.ForceScheduler( name="force", builderNames=["runtests"])) When I run the test via force option its working fine and the build is getting successful. My goal is to run it when there is a new push to Gerrit. So the change_source is as follows: c['change_source'] = [] c['change_source'].append(changes.GerritChangeSource(gerrit_url, gerrit_user, debug=True, handled_events=["patchset-created", "comment-added"])) This is directly adapted from docs/examples/git_gerrit.cfg. But even with debug set to True, I am not receiving any events in the logs, nor it's triggering any builds. I have a python program that connect to Gerrit with same username over ssh to post the events to slack, which is receiving events just fine. So I can confirm that the given user has permission to receive events from Gerrit. Also I am getting following errors if I didn't supply the key using ssh-add before reconfig of build bot. So its atleast trying to connect to Gerrit 2023-09-01 19:05:23+0530 [-] GerritChangeSource:user at server:29418: starting 'gerrit stream-events' 2023-09-01 19:05:23+0530 [-] GerritChangeSource:user at server:29418 stderr: user at server: Permission denied (publickey). 2023-09-01 19:05:23+0530 [-] GerritChangeSource:user at server:29418: stream-events failed; restarting after 19s. I am at a loss to identify what's wrong here, any help to get this moving will be much helpful. I have attached full master.cfg to this mail for reference. Thanks X -------------- next part -------------- A non-text attachment was scrubbed... Name: master.cfg Type: application/octet-stream Size: 4658 bytes Desc: not available URL: