2.5.3.14. GerritEventLogPoller


RemiZOffAlex  Создано: 2021-12-25 02:47:47.738371  Обновлено: 2021-12-25 02:47:47.738386
classbuildbot.changes.gerritchangesource.GerritEventLogPoller

The GerritEventLogPoller class is similar to GerritChangeSource but connects to the Gerrit server by its HTTP interface and uses the events-log plugin.

Note that the decision of whether to use GerritEventLogPoller and GerritChangeSource will depend on your needs. The trade off is:

  1. GerritChangeSource is low-overhead and reacts instantaneously to events, but a broken connection to Gerrit will lead to missed changes

  2. 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.

Note

The GerritEventLogPoller requires either the txrequest or the treq package.

The GerritEventLogPoller accepts the following arguments:

baseURL

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 baseURL is https://example.com/a. Ensure that /a is included.

auth

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 treq.

handled_events

Event to be handled (optional). By default processes patchset-created and ref-updated.

pollInterval

Interval in seconds between polls (default is 30 sec).

pollAtLaunch

Determines when the first poll occurs. True = immediately on launch (default), False = wait for one pollInterval.

gitBaseURL

The git URL where Gerrit is accessible via git+ssh protocol.

get_files

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.

debug

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.

© RemiZOffAlex