pull_request_read drops merge_commit_sha
還沒有人認領這個 Issue。
評估
研究方向
從 pkg/github/pullrequests.go 開始,閱讀 GetPullRequest、convertToMinimalPullRequest 和 MinimalPullRequest。新增保留合併提交 SHA 的支援,然後驗證對於已合併的 pull request,使用 method get 的 pull_request_read 會公開 merge_commit_sha。
由索引模型根據 Issue 內容生成。
描述
Describe the bug
pull_request_read with method: get does not return the pull request's merge_commit_sha, so there is no way to get from a merged pull request to the commit the merge produced without a second call.
In the source, GetPullRequest fetches the full pull request and then returns convertToMinimalPullRequest(pr). MinimalPullRequest carries merged, merged_at, merged_by, head and base, but has no merge_commit_sha field, so the value is dropped during conversion. merge_commit does not appear anywhere in pkg/github/pullrequests.go.
Affected version
Unknown. Observed through a hosted GitHub MCP integration on 2026-09-06, where the server version is not exposed to me. The code references above are from the repository's default branch on that date and may not match the build that was serving the request.
Steps to reproduce the behavior
- Call
pull_request_readwithmethod: getfor a merged pull request. - Inspect the returned object.
Expected vs actual behavior
Expected: merge_commit_sha is present for a merged pull request, as the REST API returns it.
Actual: the field is absent. Callers fall back to listing commits and matching on merge time or on the pull request number in the commit message, both of which are unreliable on an active branch.
Logs
None captured beyond the returned object.
- 主要語言
- Go
- 星號
- 33.1k
- 分支
- 5k
- 平均合併
- 2 天 15 小時
- 30 天內合併 PR
- 27
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/github-mcp-server 的其他 Issue
-
enhancement
難度 1/5 1 小時以內 新手友好度 88/100
github/github-mcp-server#3042 · 2 則留言 ·
-
bug
難度 2/5 1-3 小時 新手友好度 72/100
github/github-mcp-server#3032 · 1 個 reaction ·
-
難度 2/5 1-3 小時 新手友好度 74/100
github/github-mcp-server#2803 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 76/100
github/github-mcp-server#2740 ·
-
enhancement
難度 2/5 1-3 小時 新手友好度 76/100
github/github-mcp-server#2661 · 1 則留言 ·
查看 github/github-mcp-server 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
-
難度 1/5 1 小時以內 新手友好度 84/100
-
enhancement needs triage
難度 2/5 1-3 小時 新手友好度 68/100
-
kind/cleanup
難度 2/5 1-3 小時 新手友好度 88/100
kubernetes-sigs/kueue#15947 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
sympozium-ai/sympozium#627 ·