First-party app
Gerrit Code Review

Gerrit

Gerrit: search and review changes, vote on labels, submit or abandon, and inspect projects.

stable Version ControlDeveloper Tools

About

Gerrit ships in the w6w first-party pack. It declares 11 actions, 2 health checks, and the host runs its code in a sandbox that never sees the credential.

App id
io.w6w.gerrit
Version
0.1.1
Author
w6w
Licence
MIT
Categories
Version Control · Developer Tools

Overview

Gerrit is the code-review tool sitting in front of a Git repository, and this app searches and reviews changes without leaving a workflow. Pull changes by Gerrit’s own query language, read one change’s full state — labels, reviewers, current revision, whether it’s mergeable — and vote on a review label, add a reviewer, or leave a comment.

Submitting and abandoning changes are both supported, including reporting the chain of unmerged ancestors a submit would also merge, so a workflow automating a merge doesn’t unknowingly take dependent changes along without confirming it first. Comments and touched files come back keyed for straightforward inspection, and votes are read out separately as blocking versus approving, matching Gerrit’s actual per-label scale rather than treating them as a simple sum.

A fit for automating code-review status checks, tracking which changes are ready to merge, or bridging Gerrit review activity into notifications and dashboards elsewhere — especially useful since each Gerrit instance is self-hosted and has no shared status page to watch instead.

Build with Gerrit

Three routes to the same 11 actions. The Workflow tab is generated from Gerrit's own manifest and carries its real ids, so it is copy-pasteable; the Code and CLI examples are the same call for any action on any app, so every app-specific value in them is a blank you fill in.

Search accounts

account-search

Resolve people to the ids Gerrit accepts. INACTIVE accounts still resolve and cannot be added as reviewers, so a review assigned to somebody who left fails at assignment rather than lookup. Visibility is a server policy, so an empty result is ambiguous.

Abandon or restore a change

change-abandon

Close a change without merging, or bring it back — REVERSIBLE, with patch sets, comments and votes intact, which is what makes abandoning a stale queue a reasonable automation. Gerrit notifies the author, so a message is required.

List a change's comments

change-comments-list

Inline review comments, keyed BY FILE PATH rather than as a list — including `/COMMIT_MSG`, which Gerrit treats as a reviewable file. Separates UNRESOLVED threads, which on many projects block a submit by themselves.

List a change's files

change-files-list

What a change touches, keyed by path — with `/COMMIT_MSG` among the entries, so a naive file count is one too many. A modified file has NO status letter, which is why filtering on `M` matches nothing.

Get a change

change-get

One change with everything that decides whether it merges. Gerrit's votes are NOT ADDITIVE: a `-2` blocks outright and three `+1`s are not an approval. Also reports unresolved comments, which block a submit on many projects.

Review a change

change-review

Vote on a change and leave a message. `Verified` is the label CI should use; `Code-Review +2` is a person taking responsibility for the code. The scale is NOT ADDITIVE — a `-2` blocks outright and three `+1`s are not an approval.

Add a reviewer

change-reviewer-add

Ask somebody to review, or CC them — Gerrit distinguishes 'you must look' from 'you should know', which most review tools do not. A GROUP name expands to its members, and an unresolvable name comes back inside a 200 rather than as an error.

Search changes

change-search

Gerrit's query language, passed through — `status:open owner:self`, `is:submittable`, `label:Code-Review=-2`. A change comes back as a SKELETON unless options are requested, so reading `labels` without asking for them looks like nobody has voted.

Submit a change

change-submit

Merge a change into its branch — irreversible, since the remedy is a revert rather than an undo. Checks `submittable` first so a refusal is legible, and reports the DEPENDENCY CHAIN, because submitting a change also merges its unmerged parents.

List projects

project-list

The repositories, returned KEYED BY NAME — and a Gerrit project name is a path with slashes in it. Separates `All-Projects` and `All-Users`, which are configuration repositories rather than code, and reports read-only ones.

Get server info

server-info-get

What this Gerrit is and how it is configured — the version, and the two settings that change how the API behaves: ACCOUNT VISIBILITY, which can make a reviewer unresolvable without an error, and the auth type, which decides whether HTTP passwords exist.

A workflow step names the app and the action, and the editor fills in the connection when you pick one. This is the Step shape from the workflow spec, carrying Gerrit's real ids.

{
  "manifestVersion": "2",
  "name": "gerrit-example",
  "steps": [
    {
      "id": "account-search",
      "uses": {
        "app": "io.w6w.gerrit",
        "action": "account-search",
        "connection": "conn_YOUR_CONNECTION_ID"
      },
      "with": {
        "q": "<q>"
      }
    }
  ]
}

Here are some of the things you can do

  • Search accounts

    search
    account-search
  • Abandon or restore a change

    perform
    change-abandon
  • List a change's comments

    read
    change-comments-list
  • List a change's files

    read
    change-files-list
  • Get a change

    read
    change-get

+6 more actions available

Every app-specific value here is a blank you have to fill in. An app action is reached through the connection that authenticates it, so the address is a connection id, not the app id — and connections belong to your account, so a public page cannot know yours. Create one for Gerrit, then fill in the three blanks: conn_YOUR_CONNECTION_ID, the action key, and the parameters that action declares. The call itself is real — the shape is transcribed from the studio's own snippet builder, which prints the same kind of blanks — but nothing in it is specific to Gerrit. The Workflow tab is where this app's real ids are.

Install
npm install @w6w/sdk
yarn add @w6w/sdk
pnpm add @w6w/sdk
deno add npm:@w6w/sdk
Code
import { W6wClient, isActionRun } from "@w6w/sdk";

// Reads W6W_BASE_URL and W6W_TOKEN from the environment when omitted.
const client = new W6wClient();

const envelope = await client.run({
  urn: "conn_YOUR_CONNECTION_ID",
  action: "account-search",
  payload: {
    q: "<value>",
    // includeInactive: "<value>",
    // limit: "<value>",
  },
});

if (isActionRun(envelope)) console.log(envelope.value);
Install the CLI
npm install -g @w6w/cli
CLI
w6w run conn_YOUR_CONNECTION_ID --action account-search --payload '{"q":"<value>"}'

Give an AI agent Gerrit — without giving it Gerrit's credentials. One MCP endpoint exposes every app, function and workflow the caller is entitled to, as tools it can discover and run. Access is granted per team while we onboard.

One tool call
{
  "name": "w6w_invoke",
  "arguments": {
    "ref": "app:io.w6w.gerrit#account-search",
    "input": {
      "q": "<q>"
    }
  }
}

Every tool names its target with a single ref. The app: form above doesn't name a connection at all — the host resolves which of the caller's Gerrit connections to sign with, and refuses rather than guesses when the answer is ambiguous.

What the agent gets

Credentials it can't read

The token is attached host-side, at the moment of the call. It is never a tool argument, never in the model's context, and never in a transcript — so a prompt injection has nothing to exfiltrate.

A tool surface scoped to the caller

Tools are derived per end user from what that person has actually connected and is entitled to — not one shared bot identity carrying the union of everyone's access.

A durable workflow in one call

Multi-step work runs on the workflow engine and returns a run handle the agent can poll — retries, branching and state survive the conversation that started them.

Health-aware discovery

Gerrit's declared health checks are on the surface too, so an agent can tell "the vendor is down" from "your credential expired" before it burns a retry on either.

The MCP surface is part of the hosted platform. Gerrit itself is MIT, and the runtime that executes it is source-available (FSL).

Request MCP access

Health checks

Gerrit declares its own checks, so its health is a property of the app rather than something the host guesses at.

service

Gerrit status

Declared unavailable — there is no Gerrit service to have a status. It is software organisations run themselves, and the project's own site publishes no feed because it operates nobody's instance. The `instance` check reads the connection's own server.

dependency

Gerrit instance reachable

Probes this connection's Gerrit at the UNAUTHENTICATED bare path — the one place this app does not use `/a/` — so an outage cannot be confused with an expired HTTP password. Reports the version, and detects a proxy answering by the absence of the magic prefix.