Staff AI Agent System now supports Gerrit as an alternative to GitHub for pull request management. This guide explains how to configure and use Gerrit with Staff.
Gerrit integration provides the same capabilities as GitHub:
Add Gerrit configuration to your config.yaml:
# Either GitHub OR Gerrit is required gerrit: username: "your-gerrit-username" password: "your-gerrit-http-password-or-token" base_url: "https://gerrit.example.com" project: "your-project-name"
You can also configure Gerrit using environment variables:
export GERRIT_USERNAME="your-username" export GERRIT_PASSWORD="your-password-or-token" export GERRIT_BASE_URL="https://gerrit.example.com" export GERRIT_PROJECT="your-project"
When both GitHub and Gerrit are configured, GitHub takes precedence for backward compatibility. To use Gerrit when both are configured, remove the GitHub configuration.
Gerrit integration supports:
Generated change URLs follow Gerrit's standard format:
https://gerrit.example.com/c/project-name/+/12345
Agents work identically with Gerrit:
Use the config check command to verify your Gerrit setup:
./staff config-check
This will show:
See config-gerrit-example.yaml for a complete example configuration using Gerrit instead of GitHub.
All Gerrit operations include structured logging:
INFO Creating Gerrit change url=https://gerrit.example.com/a/changes/ project=my-project subject="Task ABC-123: Implement feature" branch=main topic=task/ABC-123-implement-feature
| Feature | GitHub | Gerrit |
|---|---|---|
| Changes/PRs | Pull Requests | Changes |
| Review System | GitHub Reviews | Gerrit Code Review |
| Merge | Merge PR | Submit Change |
| Close | Close PR | Abandon Change |
| URL Format | /pull/123 | /c/project/+/123 |
| Authentication | Token | Username + Password/Token |
To migrate from GitHub to Gerrit:
Existing GitHub pull requests are not affected and remain accessible.
Authentication Failed
Project Not Found
Network Issues
Enable debug logging to troubleshoot issues:
# Add to your configuration logging: level: debug
This will show detailed HTTP requests and responses for Gerrit operations.