pull_request_read drops merge_commit_sha

Aperta Adatta ai principianti
#3,235 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
84/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github, go
Ambito
api, backend

Direzione di ricerca

Inizia da pkg/github/pullrequests.go leggendo GetPullRequest, convertToMinimalPullRequest e MinimalPullRequest. Aggiungi il supporto per conservare lo SHA del commit di merge, quindi verifica che pull_request_read con il metodo get esponga merge_commit_sha per le pull request unite.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
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
  1. Call pull_request_read with method: get for a merged pull request.
  2. 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.

Lingua principale
Go
Stelle
33.1k
Fork
5k
Merge medio
2g 15h
PR unite (30g)
27

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di github/github-mcp-server

Tutte le issue di github/github-mcp-server

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.