Skip to main content

Gerrit adapter for the Hermes agent gateway

Project description

hermes-gerrit

A Gerrit code-review platform adapter for the Hermes Agent gateway. It connects to a Gerrit SSH endpoint, streams gerrit stream-events, and exposes five review tools (fetch_diff, fetch_file, fetch_change, inline_comment, review). Stream + writes go over SSH; reads use Gerrit's public REST API. Mirrors the contract of the existing OpenClaw Gerrit channel plugin so prompts and docs read the same regardless of which adapter the agent is running on.

Status

Pre-1.0. Spec-locked 2026-05-05. Implementation in progress; see the patch series plan in doc/source/developer/specs/hermes-gerrit-adapter.rst.

Installation

PyPI (production):

pip install hermes-gerrit

That's it. Hermes discovers the plugin via the hermes_agent.plugins entry-point group — no plugin.yaml required.

Dev / clone path:

Symlink (or check out) this repo into ~/.hermes/plugins/gerrit/:

git clone https://opendev.org/inaugust/hermes-gerrit ~/.hermes/plugins/gerrit

The plugin.yaml at the repo root is what the dev/clone path uses to discover the plugin.

hermes-agent itself must be installed separately — it is not a runtime dependency of this package.

Required environment

Variable Purpose
GERRIT_SERVER Gerrit SSH host (e.g. review.opendev.org)
GERRIT_USER SSH username
GERRIT_SSHKEY Path to the private SSH key to authenticate with

Read tools (fetch_diff, fetch_file, fetch_change) hit Gerrit's public REST API at https://${GERRIT_SERVER}/... with no authentication; only the SSH key is required, and only for stream-events and writes (inline_comment, review).

Required Gerrit account permissions

The Gerrit account whose SSH key you give the adapter must have:

  • SSH access (the Stream Events capability is server-wide; ask your Gerrit admin if gerrit stream-events rejects you).
  • label-Code-Review permission in the relevant project's refs/heads/* ACL, with a range that includes -1..+1. The adapter hard-clamps Code-Review votes to ±1 — never +2/-2.
  • No label-Verified or label-Workflow permissions are needed — those labels are hard-zeroed in code (only Zuul votes Verified, only humans set Workflow).

Configuration

Multi-account, mirrored from the TS plugin's channels.gerrit.accounts.<id> shape. In hermes' platform config:

gateway:
  platforms:
    gerrit:
      enabled: true
      extra:
        accounts:
          opendev:
            host: review.opendev.org
            port: 29418
            username: my-bot
            sshKeyPath: ~/.ssh/id_ed25519
            allowFrom:
              - alice
              - bob
            projects:
              - openstack/nova
              - openstack/keystone
            mentionNames:
              - my-bot
            enabled: true

The projects allowlist is mandatory — see the safety section of the spec for why an empty/missing allowlist must fail validation rather than silently watch nothing.

Tests

pip install -e .
pip install -r test-requirements.txt
pytest -q

Documentation

Build the docs locally with:

nox -s docs

Output lands in doc/build/html/.

Spec

The authoritative design doc is doc/source/developer/specs/hermes-gerrit-adapter.rst. Every implementation patch in this repository traces back to a decision in that file.

License

GPL-3.0-or-later. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hermes_gerrit-0.0.1.dev26.tar.gz (126.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hermes_gerrit-0.0.1.dev26-py3-none-any.whl (51.3 kB view details)

Uploaded Python 3

File details

Details for the file hermes_gerrit-0.0.1.dev26.tar.gz.

File metadata

  • Download URL: hermes_gerrit-0.0.1.dev26.tar.gz
  • Upload date:
  • Size: 126.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for hermes_gerrit-0.0.1.dev26.tar.gz
Algorithm Hash digest
SHA256 bbe7ad5318c813506d772d17f4894975d6a4f608d9f67bb8033c1ad1625ecc24
MD5 cb0568ccde43ec213e9d929bf18eaa26
BLAKE2b-256 7ba6699b3db86ed19389cb0d8fe22c9ba299206913009921faf0d0fb36b793f6

See more details on using hashes here.

File details

Details for the file hermes_gerrit-0.0.1.dev26-py3-none-any.whl.

File metadata

File hashes

Hashes for hermes_gerrit-0.0.1.dev26-py3-none-any.whl
Algorithm Hash digest
SHA256 6a94b883754f137e035ca56b84c1380815478aa6b58ec9795ff6e0eaa74acfe2
MD5 3d25e6e92bcd04500c8f6286b0433ccf
BLAKE2b-256 4d460a2ef2a7e74ef32776a6bb25f9f65dbdb3264e54c2345b2f1359d57a6c3a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page