The GerritChangeSource class connects to a Gerrit server by its SSH
interface and uses its event source mechanism,
gerrit stream-events.
This class adds a change to the buildbot system for each of the following events:
patchset-createdcheckpatch.pl can be
automatically triggered. Beware of what kind of automatic task you trigger.
At this point, no trusted human has reviewed the code, and a patch could be
specially crafted by an attacker to compromise your buildslaves.
ref-updatedThis class will populate the property list of the triggered build with the info received from Gerrit server in JSON format.
In case of “patchset-created” event, these properties will be:
event.change.branchevent.change.idevent.change.numberevent.change.owner.emailevent.change.owner.nameevent.change.projectevent.change.subjectevent.change.urlevent.patchSet.numberevent.patchSet.refevent.patchSet.revisionevent.patchSet.uploader.emailevent.patchSet.uploader.nameevent.typeevent.uploader.emailevent.uploader.nameIn case of “ref-updated” event, these properties will be:
event.refUpdate.newRevevent.refUpdate.oldRevevent.refUpdate.projectevent.refUpdate.refNameevent.submitter.emailevent.submitter.nameevent.typeevent.submitter.emailevent.submitter.name from buildbot.changes.gerritchangesource import GerritChangeSource
c['change_source'] = GerritChangeSource(gerrit_server, gerrit_user)
see
master/docs/examples/repo_gerrit.cfg in the Buildbot distribution for an example setup of GerritChangeSource.