All posts

What Gerrit JSON-RPC actually does and when to use it

You can tell an engineering team’s maturity by how many ways they’ve tried to automate code review. Gerrit is often the backbone of that process, but its integration story can feel like it’s still living in 2011. Enter Gerrit JSON-RPC, the old yet surprisingly useful interface that lets external tools talk to Gerrit through lean, structured calls instead of brittle web scraping or plugin glue. Gerrit JSON-RPC gives you a programmable handle on user sessions, patch sets, and review actions. Inst

Free White Paper

JSON Web Tokens (JWT) + End-to-End Encryption: The Complete Guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free. No spam. Unsubscribe anytime.

You can tell an engineering team’s maturity by how many ways they’ve tried to automate code review. Gerrit is often the backbone of that process, but its integration story can feel like it’s still living in 2011. Enter Gerrit JSON-RPC, the old yet surprisingly useful interface that lets external tools talk to Gerrit through lean, structured calls instead of brittle web scraping or plugin glue.

Gerrit JSON-RPC gives you a programmable handle on user sessions, patch sets, and review actions. Instead of clicking through the web UI, you can approve, query, or recheck changes from your automation pipelines. It’s a quiet bridge between human review and system workflows, and when wired right, it becomes the muscle behind continuous delivery approvals and compliance-grade audit logs.

Unlike HTTP REST APIs, JSON-RPC in Gerrit is purely procedural. You call methods, Gerrit executes them, and you get exactly one response. No nested resources or pagination puzzles. This simplicity makes it perfect for internal automation where predictability beats flexibility. A typical setup allows Jenkins, GitLab runners, or internal bots to submit review actions just like real users, mapped through identity and permission layers.

The workflow starts with authentication. Gerrit checks the caller’s session or cookie, validates it against its account database, and executes the requested method. Add a service account with scoped permissions instead of reusing admin credentials, and your automation gains least-privilege access. The data path stays concise: one JSON object in, one JSON object out. That clarity is part of its charm.

Best practices when using Gerrit JSON-RPC

Reserve JSON-RPC for controlled internal traffic, ideally behind TLS with restricted origin. Rotate service tokens frequently and log invocation metadata for audits. If you’re integrating with Okta or AWS IAM, wrap your RPC calls with short-lived tokens derived from those sessions. It keeps reviews fast and compliant with SOC 2 and ISO 27001 demands.

Continue reading? Get the full guide.

JSON Web Tokens (JWT) + End-to-End Encryption: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

Tangible benefits

  • Faster automated approvals across multiple Gerrit instances
  • Reduced API overhead compared to REST polling
  • Clean, structured logs that map directly to review events
  • Lower friction for CI/CD bots that need deterministic results
  • Tighter control over who and what can trigger Gerrit actions

For developers, this cuts the wait from commit to merge. A review bot can vote +1 in milliseconds, and your dashboard updates instantly. Less tab-switching, fewer email chases, more shipping. This small protocol helps teams reach peak developer velocity without fancy orchestration layers.

AI copilots now ride the same pipeline. Automated review agents can use Gerrit JSON-RPC to fetch change metadata, analyze patterns, and propose comments without scraping HTML. That’s safer and more maintainable than the “browser puppeteer” approach AI tools often resort to.

Platforms like hoop.dev turn those access rules into guardrails that enforce policy automatically. By linking identity-aware proxies with Gerrit’s RPC layer, hoop.dev ensures only verified agents and users perform actions, regardless of network or environment. It makes governance automatic, not an afterthought.

How do I connect Gerrit JSON-RPC to my CI system?

Point your CI task to Gerrit’s /gerrit/rpc/ endpoint, attach an authenticated session or cookie, and send a JSON-RPC method call like review or query. The response payload returns structured confirmation you can parse into your pipeline outputs. Simple, durable, and boring — which is exactly what automation should feel like.

Gerrit JSON-RPC may look dated, but it earns its place by being lightweight, predictable, and easy to secure. For teams chasing reliable automation, it’s still worth knowing by heart.

See an Environment Agnostic Identity-Aware Proxy in action with hoop.dev. Deploy it, connect your identity provider, and watch it protect your endpoints everywhere—live in minutes.

Get started

See hoop.dev in action

One gateway for every database, container, and AI agent. Deploy in minutes.

Get a demoMore posts