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-created
checkpatch.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-updated
This 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.branch
event.change.id
event.change.number
event.change.owner.email
event.change.owner.name
event.change.project
event.change.subject
event.change.url
event.patchSet.number
event.patchSet.ref
event.patchSet.revision
event.patchSet.uploader.email
event.patchSet.uploader.name
event.type
event.uploader.email
event.uploader.name
In case of “ref-updated” event, these properties will be:
event.refUpdate.newRev
event.refUpdate.oldRev
event.refUpdate.project
event.refUpdate.refName
event.submitter.email
event.submitter.name
event.type
event.submitter.email
event.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
.