Skip to content

Commit

Permalink
Add example
Browse files Browse the repository at this point in the history
  • Loading branch information
hgenru committed Dec 10, 2013
1 parent 513c14d commit 0f9ac74
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions master/docs/manual/cfg-changesources.rst
Expand Up @@ -1230,18 +1230,25 @@ By default this class adds a change to the buildbot system for each of the follo
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.
But you can specify how to handle Events:

* Any event with change and patchSet will
be processed by universal collector by default.

* In case you've specified processing function for the given kind of events,
all events of this kind will be processed only by this function, bypassing universal collector.

An example::

from buildbot.changes.gerritchangesource import GerritChangeSource
class MyGerritChangeSource(GerritChangeSource):
"""Custom GerritChangeSource
"""
def eventReceived_patchset_created(self, properties, event):
"""Handler events without properties
"""
properties = {}
self.addChangeFromEvent(properties, event)

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

0 comments on commit 0f9ac74

Please sign in to comment.