GerritChangeSource is low-overhead and reacts instantaneously to events, but a broken connection to Gerrit will lead to missed changes
GerritEventLogPoller is subject to polling overhead and reacts only at it’s polling rate, but is robust to a broken connection to Gerrit and missed changes will be discovered when a connection is restored.
You can use both at the same time to get the advantages of each. They will coordinate through the database to avoid duplicate changes generated for buildbot.
GerritEventLogPoller requires either the
txrequest or the
GerritEventLogPoller accepts the following arguments:
The HTTP url where to find Gerrit. If the URL of the events-log endpoint for your server is
https://example.com/a/plugins/events-log/events/ then the
https://example.com/a. Ensure that
/a is included.
A request’s authentication configuration. If Gerrit is configured with
BasicAuth, then it shall be
('login', 'password'). If Gerrit is configured with
DigestAuth, then it shall be
requests.auth.HTTPDigestAuth('login', 'password') from the requests module. However, note that usage of
requests.auth.HTTPDigestAuth is incompatible with
Event to be handled (optional). By default processes patchset-created and ref-updated.
Interval in seconds between polls (default is 30 sec).
Determines when the first poll occurs. True = immediately on launch (default), False = wait for one pollInterval.
The git URL where Gerrit is accessible via git+ssh protocol.
Populate the files attribute of emitted changes (default False). Buildbot will run an extra query command for each handled event to determine the changed files.
Print Gerrit event in the log (default False). This allows to debug event content, but will eventually fill your logs with useless Gerrit event logs.
The same customization can be done as
GerritChangeSource for handling special events.