Description
GitHub Pull Request Ingest fetches a repository’s open, closed, and merged pull requests into the Pull Requests Dotabase. The command accepts an owner/repository target or resolves one from a local checkout, pages the GitHub API with a personal access token, maps each PR to a stable row keyed by its immutable node identifier, and posts records to Dots in batches.
Each pull request includes a bounded fetch of its member commit SHAs. Downstream matching draws typed contains relationships from the PR to Git Commit rows, allowing graph consumers to connect review context with the commits, files, code symbols, and conversations involved. A resumable cursor ensures a rate limit or interruption continues from saved progress rather than starting the entire repository again.
Selling Points
- Captures review intent, state, labels, authorship, and merge context alongside code history.
- Imports open, merged, and closed pull requests rather than only the current queue.
- Resumes paginated work after interruption or rate limiting.
- Uses immutable GitHub node IDs for idempotent re-fetches.
- Links pull requests to their member commits for end-to-end graph traversal.
User Story
As an engineering lead, I fetch a repository’s pull requests and gain a searchable history of why changes were proposed and reviewed. From a PR I can follow its commits into affected files and related coding conversations instead of treating delivery metadata as a disconnected system.
Extension Surface
The rating is automatable because packages/cli/src/commands/github-pr-client.ts exposes injected fetch, cursor, and page callbacks, while packages/cli/src/commands/git.ts provides a scriptable command. packages/ingestion/src/repo/provenance/git-commits.ts resolves a checkout into a GitHub owner/repository target. The GitHub REST mapping is fixed and requires a token; it is not a general provider plug-in.
Capabilities & Limits
Capabilities include path or owner/repo target resolution, PAT discovery, all-state pagination, per-PR commit membership, resumable cursors, batch upload, idempotent row mapping, and PR-to-commit edge matching. Limits are explicit: no token means a fail-closed no-write result, GitHub caps the commits listing for a pull request, and this command does not ingest reviews or comments as separate rows.
Implementation Map
packages/ingestion/src/repo/provenance/git-commits.tspackages/cli/src/commands/github-pr-client.tspackages/cli/src/commands/git.tspackages/api/src/services/git-ingest.ts