Skip to content

Commit

Permalink
Update cfg-changesources.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
hgenru committed Dec 2, 2013
1 parent f882fd3 commit dcd8394
Showing 1 changed file with 37 additions and 3 deletions.
40 changes: 37 additions & 3 deletions master/docs/manual/cfg-changesources.rst
Expand Up @@ -1195,9 +1195,27 @@ GerritChangeSource
The :bb:chsrc:`GerritChangeSource` class connects to a Gerrit server by its SSH
interface and uses its event source mechanism,
`gerrit stream-events <http://gerrit.googlecode.com/svn/documentation/2.1.6/cmd-stream-events.html>`_.
`gerrit stream-events <http://gerrit.googlecode.com/svn/documentation/2.2.1/cmd-stream-events.html>`_.

This class adds a change to the buildbot system for each of the following events:
The :bb:chsrc:`GerritChangeSource` accepts the following arguments:

``gerritserver``
the dns or ip that host the gerrit ssh server

``gerritport``
the port of the gerrit ssh server

``username``
the username to use to connect to gerrit

``identity_file``
ssh identity file to for authentication (optional)

``handled_events``
event to be handled (optional)
by default processes `patchset-created` ad `ref-updated`

By default this class adds a change to the buildbot system for each of the following events:

``patchset-created``
A change is proposed for review. Automatic checks like
Expand All @@ -1211,6 +1229,19 @@ This class adds a change to the buildbot system for each of the following events
of event can lead to a complete rebuild of the project, and upload
binaries to an incremental build results server.

But you can manually specify which handle Events:

``any event containing bb::change and bb:patchSet``
Any event containing bb:`change` and bb:`patchSet`
universal collector can be processed unless you explicitly
specify processing them in handle_events parameter.
(see `gerrit stream events man page <http://gerrit.googlecode.com/svn/documentation/2.2.1/cmd-stream-events.html>`_)

``any event with its own handler function``
In heir class :bb:chsrc:`GerritChangeSource`
can override processing functions needed the events.
The eigenfunctions processing will always be more important than universal.

This class will populate the property list of the triggered build with the info
received from Gerrit server in JSON format.

Expand Down Expand Up @@ -1275,7 +1306,10 @@ In case of ``ref-updated`` event, these properties will be:
A configuration for this source might look like::

from buildbot.changes.gerritchangesource import GerritChangeSource
c['change_source'] = GerritChangeSource(gerrit_server, gerrit_user)
c['change_source'] = GerritChangeSource(
"gerrit.example.com",
"gerrit_user",
handled_events=["patchset-created", "change-merged"])

see :file:`master/docs/examples/repo_gerrit.cfg` in the Buildbot distribution
for a full example setup of :bb:chsrc:`GerritChangeSource`.
Expand Down

0 comments on commit dcd8394

Please sign in to comment.