Dataset
Gerrit code review history datasets for AI training
A Gerrit dataset is the review record of a company's Gerrit Code Review server: each change proposed to its Git repositories, every patch set uploaded for that change, the inline comments and change messages, the label votes such as Code-Review and Verified, and the submit or abandon outcome. SourceX sources it to a buyer's spec from established businesses that run Gerrit Code Review for their own code. Each dataset is de-identified and licensed for an agreed permitted use.
Dataset manifest
Sourced to your spec- What it is
- Changes from private Gerrit projects with all patch sets, inline comments, change messages, label votes, reviewers and submit or abandon outcomes
- Typical systems
- Gerrit Code Review with NoteDb, its REST API and SSH query commands, the replication plugin, and CI systems that vote Verified
- Typical history
- Specified by the buyer; a server keeps every patch set of every change unless changes were deleted or left behind in a migration
- Modality
- Git commits and diffs, review comments and messages as text, and label votes and change state as structured records
- Delivery formats
- Agreed per order; a Git mirror including change and meta refs, or ChangeInfo and CommentInfo JSON as JSONL with per-patch-set diffs
- Preparation
- Account IDs, names and emails re-keyed consistently in commits, footers, votes and comments; secrets screened in every patch set
- Licensing
- Rights reviewed per project, including third-party code and whether abandoned and private changes are in scope; permitted use set in the license
- Availability
- Sourced to your spec by language, project and change count; supply is not guaranteed
What a delivery contains
Fields vary by source system and are fixed per order. A typical delivery includes:
| Field | Type | What it holds |
|---|---|---|
| change_key | string | The Change's identity, re-keyed: its Project, destination branch and Change-Id, plus the server's change number. |
| status | object | The Change's status of NEW, MERGED or ABANDONED, with its work_in_progress and is_private flags. |
| commit_message | string | The commit message of the current Patch set, with its subject line and footers including Change-Id. |
| patch_sets | array | Each Patch set as a RevisionInfo: number, commit, ref, kind, created time, uploader and changed files. |
| inline_comments | array | Each Inline comment as a CommentInfo: patch_set, path, side, line or range, message, in_reply_to, unresolved and author. |
| change_messages | array | Each Change message with author, date, the patch set it refers to and its tag, which marks autogenerated messages. |
| label_votes | array | Each Label vote, from ApprovalInfo entries and the meta ref: label, value, voter, date and the Patch set it was cast on. |
| label_definitions | object | Label ranges and value meanings from the Project's project.config. |
| reviewers | object | Reviewer accounts by state: REVIEWER, CC or REMOVED. |
| topic_and_hashtags | object | The Change's Topic string and its Hashtag list, which group changes across projects. |
| related_changes | array | Related change links: the parent chain of a stack, cherry_pick_of_change, revert_of and changes submitted together. |
| submit | object | The Submit record or submit requirement results, the project's submit type, submitter, time and the commit that landed. |
| account_roles | object | For each re-keyed account, the Group memberships that matter to review and a flag for service users. |
| source_path | enum | notedb_mirror, rest_api or ssh_query, the route the record was read by. |
Field names from the table above; values are masked placeholders.
Example record
{
"change_key": "proj_billing-core~main~I7f3c9a2b41d0e8c65a1f0b9d3e2c4a6b8d0f1e23",
"status": {
"status": "MERGED"
},
"commit_message": "Retry ledger writes on serialization failure\n\nChange-Id: I7f3c9a2b41d0e8c65a1f0b9d3e2c4a6b8d0f1e23",
"patch_sets": [
{
"_number": 1,
"ref": "refs/changes/72/41872/1",
"kind": "REWORK"
},
{
"_number": 2,
"ref": "refs/changes/72/41872/2",
"kind": "REWORK"
},
{
"_number": 3,
"ref": "refs/changes/72/41872/3",
"kind": "TRIVIAL_REBASE"
}
],
"inline_comments": [
{
"patch_set": 1,
"path": "ledger/post.go",
"line": 112,
"message": "Unbounded loop if the conflict never clears. Cap attempts.",
"unresolved": true,
"author": "acct_1007"
}
],
"change_messages": [
{
"author": "acct_svc_ci",
"_revision_number": 2,
"tag": "autogenerated:ci",
"message": "Patch Set 2: Verified+1"
}
],
"label_votes": [
{
"label": "Code-Review",
"value": -1,
"account": "acct_1007",
"patch_set": 1
},
{
"label": "Verified",
"value": 1,
"account": "acct_svc_ci",
"patch_set": 2
},
{
"label": "Code-Review",
"value": 2,
"account": "acct_1007",
"patch_set": 2
}
],
"label_definitions": {
"Code-Review": {
"min": -2,
"max": 2
},
"Verified": {
"min": -1,
"max": 1
}
},
"reviewers": {
"REVIEWER": [
"acct_1007",
"acct_svc_ci"
]
},
"topic_and_hashtags": {
"topic": "ledger-retries",
"hashtags": []
},
"related_changes": [
{
"parent_change": 41869
}
],
"submit": {
"submit_type": "REBASE_ALWAYS",
"approved_patch_set": 2,
"landed_patch_set": 3
},
"account_roles": {
"acct_svc_ci": {
"service_user": true
}
},
"source_path": "rest_api"
}Synthetic record for illustration. Field names, structure and format are agreed per order.
What AI teams use it for
Train review models on comment and fix pairs
An inline comment on one patch set and the next patch set's diff at the same lines form a labeled pair of critique and response.
Predict votes from a diff
Code-Review values per patch set give a graded target that separates a blocking objection from a minor one.
Separate human judgment from CI results
Verified votes and bot-tagged messages can be held out, so a model learns from reviewers and is tested against the build.
Learn from rejected work
Abandoned changes with their last comments show code a team declined and why.
Teach agents to split work into reviewable commits
Stacks of dependent changes under one topic show how engineers ordered a large change into single commits.
Use-case guides: Coding agents, Private evaluation sets, Enterprise and computer-use agents
What makes this data valuable
Meta refs present
A mirror that includes refs/changes with each change's meta ref, not branches alone.
Votes kept per patch set
Approvals recorded on the patch set they were cast on, with copied and removed votes distinguishable.
Bots identifiable
Service accounts flagged and CI messages tagged, so automated text can be filtered.
Label definitions delivered
The project.config for each project, including inherited labels and copy conditions.
Abandoned changes in scope
Abandoned changes included by agreement, with their status and last messages.
Rebases marked
The kind of each patch set, so a rebase is not read as a response to review.
Record timeline
Gerrit dataset
One commit per change, and two kinds of score on every patch set
In Gerrit the unit of review is a single commit. A developer pushes a commit to a refs/for branch, and the Change-Id footer in its message identifies the change. To answer a review, the developer amends that commit and pushes again. The same Change-Id tells Gerrit to record a new patch set of the same change, and every patch set is kept as its own commit under refs/changes. Each revision stays retrievable in full, where branch-based review can lose it to a force push. Work too large for one commit is pushed as a chain of commits, each its own change with its own review, linked by Git parentage and often a shared topic.
Each patch set carries label votes. By convention Code-Review runs from -2 to +2 and is cast by people, and Verified runs from -1 to +1 and is cast by CI. Reviewer judgment and build results are therefore separate, attributed numeric signals on each revision. Projects define their own labels, ranges and meanings in project.config, so the definitions have to travel with the votes.
The model has traps. A new patch set is not always a response: a rebase onto a newer parent creates one too, and the diff between two patch sets then mixes the author's edits with other people's merged work. Gerrit records a kind for each patch set, such as REWORK, TRIVIAL_REBASE or NO_CODE_CHANGE, and a label's copy condition decides whether votes carry forward, so a vote shown on the latest patch set may have been cast on an earlier one. Inline comments are anchored to one patch set, file, side and line.
The review record lives in refs a normal clone never fetches
Since Gerrit moved its review data into NoteDb, change metadata is stored in the project repositories themselves. Each change has a meta ref beside its patch set refs under refs/changes. The meta ref is a chain of small commits, one per event, whose messages carry the update as footers and whose notes hold inline comments as JSON. A mirror that fetches refs/changes therefore carries the whole review record in order, while an ordinary clone fetches branches and tags and carries none of it. Label definitions sit on refs/meta/config, which a normal clone also skips.
A mirror still lacks things. NoteDb commits identify people by numeric account ID, and names, emails and group memberships live in the server's All-Users repository, as do unpublished draft comments, which should stay out of scope. Check whether older meta commits also carry a display name in their author line. A fetch returns only the refs the fetching account may read, so a mirror made by an ordinary user silently omits private changes and restricted projects. The REST API is the other route. It returns ChangeInfo JSON, with revisions, messages and detailed labels only when requested through options, and comments from a separate endpoint. Its label entries always describe the current patch set, so votes on superseded patch sets have to be recovered from change messages, from the meta ref, or from the SSH query command's all-approvals option, which lists approvals for each patch set.
To test a sample, pick ten changes and check that every patch set's commit is present. Rebuild the vote history per patch set and compare it with the change messages. Then search early patch sets for secrets, since a credential removed in patch set two is still in patch set one.
What to check before licensing
- Ask whether the delivery comes from a mirror with refs/changes and meta refs, the REST API or SSH queries, and under which account's read permissions it was made.
- Confirm who owns the code in each project, including contractor and third-party contributions, vendored code and mirrored open source projects.
- Decide in writing whether abandoned, private and work-in-progress changes are in scope, since they can hold rejected, unfinished or sensitive code.
- Check that votes are attributed to the patch set they were cast on, and ask for each project's project.config to read label ranges and copy conditions.
- Scan every patch set, not only merged commits, for credentials, keys and customer data, because an early patch set keeps what a later one removed.
- Have the buyer and the data owner each check the terms that apply to the server on exported data and API use: the Gerrit project's license and, for a hosted instance, the provider's terms.
- Verify that account IDs, names and emails are re-keyed the same way in commit headers, commit message footers, votes, comments and change messages.
Delivery No files move before a signed license. A listing or a request grants no files by itself.
How licensing works through SourceX
- 1
Define
Send the domain, modality, volume, format, timeline and permitted use you need.
- 2
Source
SourceX identifies businesses that hold matching data and are open to licensing it.
- 3
Qualify
Fit, rights and quality are checked, and you review samples before committing.
- 4
License
Scope, permitted use, exclusivity, price and obligations are agreed in writing.
- 5
Deliver
Approved data is prepared, de-identified where required and transferred securely.
Questions Acquisition Partners ask
How is a Gerrit change different from a pull request?
A change is one commit under review, not a branch of commits. The author revises it by amending the commit and uploading a new patch set, and Gerrit keeps every patch set. For training data this means each review unit is small, each revision is preserved in full, and comments attach to an exact revision.
Does a Git clone of the repositories include the review history?
No, not an ordinary one. A normal clone fetches branches and tags. Patch sets and the review metadata are stored under refs/changes, including a meta ref per change, and must be fetched explicitly or with a mirror clone made by an account allowed to read them. Account names and groups are held separately in the server's All-Users repository.
Can human review be separated from CI and bot activity?
Yes, in most installations. CI systems normally vote on a different label, by convention Verified, and post through service accounts whose messages can carry a tag with the autogenerated prefix. Human reviewers vote Code-Review. Ask the supplier to flag service accounts and deliver label definitions, because projects can rename labels, add their own and let bots vote on any of them.
Are abandoned changes included?
Only if the agreed scope includes them. Gerrit keeps abandoned changes with all their patch sets, comments and votes, and they are valuable because they record what a team rejected. They can also hold experiments, unfinished work and code the owner would not want released. Agree their scope in writing, and screen them as carefully as merged code.
Why do merged commits not match the reviewed patch sets?
Because the project's submit type can rewrite the commit at submit. With cherry-pick or rebase-always submission, Gerrit creates a new commit on the branch and appends footers such as Reviewed-on and Reviewed-by, so its SHA differs from the patch set a reviewer approved. Join review records to branch history by the Change-Id footer, not by commit hash.
Is SourceX affiliated with Google or the Gerrit project?
Gerrit Code Review is named to identify the system the records come from. That does not imply a partnership with or endorsement by Google or the Gerrit project. The records belong to the business that runs Gerrit Code Review, which licenses them under a signed agreement, and a request does not guarantee a matching dataset. Buyers should still confirm with counsel that the vendor's terms allow the intended use of exported data.
Related datasets
- Code reviews and pull request histories
Private pull requests with per-revision diffs, review comments, verdicts and merge or close outcome
- Software engineering histories (issues, PRs, reviews)
Issues linked to commits, pull requests, code review, CI runs, deploys and incidents
- Proprietary codebases with full history
Complete private repositories with full version history, build files, tests and docs
- GitHub repositories and pull request histories
Private repositories with commit history, issues, pull requests, reviews, review comments, timeline events and discussions
- Phabricator revisions and task histories
Differential revisions with diffs and inline comments, Maniphest tasks, Diffusion commits and wiki pages, each with its transaction log and cross-references
Evaluating this data for procurement?
Diligence packets are prepared per dataset. Rights, privacy processing and quality differ between datasets.
Request dataset diligenceTell us what your models need
Send your spec — domain, volume, format, timeline and permitted use — and SourceX will match it against partner data and come back with what can be licensed.
Updated 26 November 2026.