Dataset
Code review and pull request datasets for AI training
A code review dataset is a collection of pull requests from private repositories, each kept with every pushed revision of its diff, the inline and summary review comments, requested changes, approvals and the merge or close outcome. SourceX sources these to a buyer's spec from established software companies that keep them in code hosts such as GitHub Enterprise, GitLab, Bitbucket and Gerrit. Author and reviewer names are replaced with pseudonyms before delivery, and buyers should confirm the pseudonyms stay consistent across pull requests. Each dataset is de-identified and licensed for an agreed permitted use.
Dataset manifest
Sourced to your spec- What it is
- Private pull requests with per-revision diffs, review comments, verdicts and merge or close outcome
- Typical systems
- GitHub Enterprise, GitLab, Bitbucket, Gerrit, Phabricator, Azure Repos
- Typical history
- Varies by partner; depends on when review was adopted and whether early revisions survive
- Modality
- Diffs as code, comments as text, anchors, verdicts and push events as structured records
- Delivery formats
- JSONL per pull request, unified diffs per revision, optional git bundle with pull request refs
- Preparation
- Author and reviewer names replaced with pseudonyms, which you should confirm stay consistent; secrets and internal URLs scrubbed from diffs and comments
- Licensing
- Scoped per repository; rights must come from the repository owner; permitted use agreed per license
- Availability
- Sourced to your spec; supply is not guaranteed and per-revision depth depends on the code host
What a delivery contains
Fields vary by source system and are fixed per order. A typical delivery includes:
| Field | Type | What it holds |
|---|---|---|
| pr_id | string | Pseudonymous, stable ID for one pull request, merge request or Gerrit change. |
| target | object | Repository, target branch, base commit at open and the merge base of each later revision. |
| pr_body | object | Title and description as the author wrote them, with template sections kept and later edits dated. |
| revisions | array | Every pushed head in order, with push time, a force-push flag, the diff against the merge base and the interdiff against the prior revision. |
| review_rounds | array | Each cycle of a submitted review and the author's replies and pushes, with the time between them. |
| inline_comments | array | Comments on specific lines, with body text, reply order, suggestion blocks and resolved or outdated state. |
| inline_comments[].anchor | object | File path, side of the diff, line range, the revision the comment was written against and the hunk the reviewer saw. |
| inline_comments[].addressed_by | object | The later revision that changed the anchored lines, or a reply-only or unaddressed marker, with how the link was made. |
| review_verdicts | array | Summary reviews with state (approved, changes requested, commented or dismissed), the revision reviewed and summary text. |
| participants | array | Pseudonymous author and reviewers with role, tenure band, prior merged changes in the touched paths and a bot flag. |
| ownership | object | Code owner rules that matched the changed paths, required reviewers and whether an owner approved. |
| outcome | object | Merged, closed without merge, superseded or abandoned, with merge method and the stated reason where one was given. |
| history_integrity | object | Whether the branch was force-pushed, rebased or squashed, and whether every earlier revision was recovered and from where. |
| pseudonymization | object | How identities were replaced, whether IDs are stable across repositories, and what was scrubbed from text. |
Field names from the table above; values are masked placeholders.
Example record
{
"pr_id": "pr_48213",
"target": { "repo": "repo_billing_api", "branch": "main", "base_at_open": "c41d7e0" },
"pr_body": { "title": "Retry invoice webhooks with backoff", "description": "Adds a retry queue. Closes [ISSUE]." },
"revisions": [
{ "n": 1, "head": "7a90f13", "pushed": "2024-03-04T14:02:11Z", "force_push": false },
{ "n": 2, "head": "e2b6c58", "pushed": "2024-03-05T09:40:37Z", "force_push": true,
"rebased_onto": "d03aa91", "interdiff": "range_diff" }
],
"review_rounds": [
{ "n": 1, "reviewed_revision": 1, "inline_comments": 2, "hours_to_response": 19.6 },
{ "n": 2, "reviewed_revision": 2, "inline_comments": 0 }
],
"inline_comments": [
{ "id": "c_1", "author": "u_0193", "state": "outdated",
"body": "This retries on every 4xx. A 410 means the endpoint is gone, so stop and disable the subscription.",
"anchor": { "path": "webhooks/retry.py", "side": "new", "lines": [58, 61], "revision": 1,
"hunk": "@@ -40,6 +52,14 @@ def schedule_retry(delivery):" },
"addressed_by": { "revision": 2, "lines": [58, 67], "link": "anchored_lines_changed",
"reply": "Done, 410 and 404 now disable the subscription." } },
{ "id": "c_2", "author": "u_0193", "state": "resolved",
"body": "Should the backoff be capped? Not blocking.",
"anchor": { "path": "webhooks/backoff.py", "lines": [12, 15], "revision": 1 },
"addressed_by": { "revision": null, "link": "reply_only", "reply": "The queue TTL already caps it." } }
],
"review_verdicts": [
{ "state": "changes_requested", "revision": 1 },
{ "state": "approved", "revision": 2 }
],
"participants": [
{ "id": "u_0771", "role": "author", "tenure_band": "under_1y", "prior_merged_in_paths": 2 },
{ "id": "u_0193", "role": "reviewer", "tenure_band": "over_5y", "prior_merged_in_paths": 148 }
],
"ownership": { "rules_matched": ["webhooks/"], "owner_ids": ["u_0193"], "owner_approved": true },
"outcome": { "state": "merged", "method": "squash", "merged_commit": "5c8e21f" },
"history_integrity": { "force_pushed": true, "all_revisions_recovered": true, "recovered_from": "push_events" },
"pseudonymization": { "ids": "stable_across_delivery", "mentions_in_text": "replaced" }
}Synthetic record for illustration. Field names, structure and format are agreed per order.
What AI teams use it for
Generating review comments on a diff
A revision and the comments anchored to it train a model to find the line that needs attention and say why.
Turning a comment into a change
A comment paired with the interdiff that answered it teaches a model to apply one piece of feedback without rewriting the rest.
Predicting what will not merge
Closed and reworked pull requests supply negative examples with stated reasons.
Evaluating an AI reviewer
Held-out pull requests show which defects human reviewers caught, a reference for scoring recall and false alarms.
Learning a codebase's unwritten rules
Repeated comments from code owners on the same paths surface conventions no linter states.
Use-case guides: Coding agents, Private evaluation sets, Enterprise and computer-use agents
What makes this data valuable
Revisions recovered
Share of pull requests with every pushed head present, not only the final diff.
Anchors that resolve
Each inline comment points to a path, lines and revision present in the delivered diffs.
Comment-to-change links
Addressed, reply-only and unaddressed comments are told apart, with the linking method stated.
Unmerged work kept
Closed, superseded and abandoned pull requests are present and classified.
Stable reviewer pseudonyms
One reviewer keeps one ID across repositories, with tenure and ownership attached.
Bots separated
Automated comments and approvals are flagged.
Document stack
Code review dataset
The review round is the training unit
The useful unit in review data is one round. A reviewer reads a specific revision and leaves a comment anchored to a line of it, and the author answers with a commit that changes those lines or with a reply explaining why not. A pull request exported as its final diff plus a list of comments has lost that structure. A comment about a missing null check sits beside code that already contains the check.
Whether the round survives depends on the code host and on how the team pushed. Gerrit keeps each uploaded version of a change as a numbered patch set, and a comment belongs to the patch set it was written on. Phabricator's Differential, found in older archives, works in a similar way. On GitHub, GitLab and Bitbucket a pull request follows a branch. If the author answered review with fixup commits, each round is a commit. If the author amended and force-pushed, the earlier head has left the branch. GitHub marks the old comments outdated and still returns the hunk and the original commit ID each was attached to, but that commit may no longer be fetchable. A squash merge leaves one commit on the main branch, so a clone of the default branch holds no intermediate state.
So ask for revisions, not commits. For each push the delivery should hold the head SHA, the time, a force-push flag, the diff against the merge base and the interdiff against the previous revision. When a branch was rebased between rounds, a plain diff of the two heads mixes upstream changes into the author's response, so the interdiff should compare patch with patch, as git range-diff does. The hosts record more than the branch shows. GitLab stores a new diff version of a merge request on each push, Azure Repos records an iteration for each push with a reason such as push, force push or rebase, and GitHub logs a force-push event on the pull request timeline. Ask what share of pull requests have every revision recovered, and treat the rest as final-diff-only records.
Rejected pull requests and reviewer weight
An export built by walking the main branch and collecting the pull requests behind its merge commits finds only accepted work. The pull requests closed without merging are where a reviewer said the approach was wrong, the change belonged in another layer or the risk was not worth it, and those explanations are scarce. Heavily reworked pull requests come next, with several rounds and a design that changed between the first revision and the last.
Closed is not the same as rejected, though. A closed pull request may have been superseded by a cleaner one, closed by a stale-branch bot after the author went quiet, or merged by hand outside the code host. Ask how outcomes were classified, and look for a human comment near the close event. Approvals need the same care, since an approval with no comments on a large diff says little.
Comments are not equal either. A remark from the engineer who owns a directory states a rule of the codebase, while the same sentence from a new joiner may be a question. Code owner files, a reviewer's earlier merged changes in the touched paths and a tenure band let a buyer weight or filter comments. All three depend on pseudonyms that stay the same across the whole delivery, because reviewer history cannot be computed when each pull request is anonymized separately. Linters and dependency bots also post review comments and need a flag so they can be counted apart.
What to check before licensing
- Ask what share of pull requests were force-pushed or squash-merged, and for how many of those every earlier revision was recovered.
- On the sample, open ten inline comments and confirm the anchored path, lines and revision exist and show the code the comment describes.
- Count closed-without-merge pull requests in the sample and ask how rejected, superseded and stale-closed ones were told apart.
- Confirm author and reviewer pseudonyms are consistent across pull requests and repositories, and that names, handles and emails are also replaced inside comment text and commit trailers. Ask whether tenure bands and ownership could single out a person on a small team.
- Confirm the license comes from the entity that owns the repository, not from an individual contributor, and ask how contractor, vendor and open-source code in the diffs was handled.
- Ask which accounts are bots, then recount comments per pull request with bots removed.
- Search diffs and comments for tokens, customer names and internal hostnames, since reviewers paste logs and stack traces into threads.
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 this different from a software engineering history dataset?
The unit is the review exchange, not the resolved task. An engineering history links an issue to the merged change, its CI runs and its deploy, with review threads as one part of that chain. This dataset keeps every revision of the diff, anchors each comment to its revision and includes pull requests that never merged.
Are force-pushed and squash-merged pull requests still usable?
Often, depending on what the host and the partner kept. A squash merge removes intermediate commits from the main branch, not necessarily from the pull request record. A force push replaces the branch head, and the earlier head may survive in the host's refs or backups. Where it does not, ask for the record to be flagged as final-diff-only.
Which code hosts preserve review rounds most completely?
Gerrit does, because its review model is built on stored revisions. Each uploaded version of a change is kept as a numbered patch set, and every comment belongs to one. GitLab and Azure Repos also record a version at each push. On GitHub and Bitbucket a pull request follows a branch, so completeness depends more on how authors pushed. Ask which host each repository used and whether it was migrated, since a migration can flatten review history.
Are pull requests that were closed without merging included?
They should be, and you should ask for them by name. Exports built from the main branch's merge history contain only accepted work. Closed pull requests carry the reasons a change was turned down, but also duplicates, stale closures and abandoned experiments, so specify that each closed record be classified and the method stated.
How are reviewer and author identities handled?
They are replaced with pseudonyms before delivery, and the method is recorded for each dataset. For review data, specify that the pseudonyms be stable, so one reviewer keeps one ID across every pull request and tenure and code ownership can be attached without naming anyone. Check comment text and commit trailers too, because people use names inside threads. No de-identification method is perfect.
Do I need the full repository to use the diffs?
For many training uses, yes. A hunk shows a few lines around the change, and review comments often refer to code elsewhere in the project. Specify whether you need the repository at each base commit, only the touched files, or the diffs alone. Full repositories widen the rights and secrets review to that of a codebase license.
Related datasets
- 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
- Human feedback and QA-scored work
Work items with scores, verdicts and corrections from the people who reviewed them
- Coding agent session traces on private repositories
Session logs of AI coding agents on private repositories, joined to the human verdict on each result
- CI/CD pipeline logs and build failures
Pipeline runs with step logs and exit codes, joined to triggering and fixing commits
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 25 November 2026. Own data like this? See how companies license it to AI developers.