| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Adds a new get_commits method to the existing pull_request_read tool so agents can list commits on a pull request with a compact, PR-focused response shape.
Changes:
| File | Description |
|---|---|
| README.md | Documents the new get_commits method under pull_request_read. |
| pkg/github/pullrequests.go | Adds the get_commits dispatch case and implements GetPullRequestCommits. |
| pkg/github/pullrequests_test.go | Adds unit coverage for get_commits (success, pagination, error). |
| pkg/github/minimal_types.go | Adds MinimalPullRequestCommit and conversion logic for PR commit listing output. |
| pkg/github/helper_test.go | Adds the REST route constant for the PR commits endpoint used by mocks. |
| pkg/github/toolsnaps/pull_request_read.snap | Updates tool schema snapshot to include get_commits. |
Sorry, something went wrong.
|
Rebased this branch onto latest main (was 1 commit behind after #2605).
Copilot's nil-slice guard feedback is already addressed in 64d25a7. |
Sorry, something went wrong.
There was a problem hiding this comment.
Code review: implementation follows existing get_files patterns, compact response shape is well-motivated for commit-message review workflows, and test coverage looks solid (success, pagination, error, nil entry, omitted noisy fields).
Only blocker is the branch being 1 commit behind main — addressed via #2613.
Sorry, something went wrong.
There was a problem hiding this comment.
Approved, I fixed the merge conflict so I will force merge with green CI
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Adds a get_commits method to pull_request_read so agents can list commits on a pull request. The response uses a compact PR-specific commit summary to keep the payload focused on commit-message review workflows.
Why
Fixes #2368
Review agents need access to the commits on a pull request so they can validate commit messages, for example checking whether commits follow Conventional Commits or another repository-specific format.
What changed
Response shape tradeoff
This PR uses a new lightweight MinimalPullRequestCommit instead of reusing the existing MinimalCommit type used by repository commit tools. MinimalCommit is a better fit for detailed commit views like get_commit, where nested git metadata, resolved GitHub users, stats, and files are useful.
For PR commit listing, the primary use case is commit-message inspection across multiple commits, so the new type avoids repeated author / committer blocks and resolved profile data that can quickly consume context without helping that workflow. If future use cases need richer commit details, callers can still fetch an individual commit through the existing repository commit tools.
Example tool/method response
[ { "sha": "b1c3b16910cfa89f7d2f19e1c31b8db143938450", "html_url": "https://github.com/github/github-mcp-server/commit/b1c3b16910cfa89f7d2f19e1c31b8db143938450", "message": "feat: add pull request commit listing", "author": { "name": "Octocat", "email": "octocat@github.com", "date": "2026-06-05T08:30:00Z" } } ]MCP impact
Prompts tested (tool changes only)
Security / limits
Tool renaming
Lint & tests
Docs