pull_request_read drops merge_commit_sha

Aberta Para iniciantes
#3,235 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
84/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
github, go
Domínio
api, backend

Direção de pesquisa

Comece em pkg/github/pullrequests.go, lendo GetPullRequest, convertToMinimalPullRequest e MinimalPullRequest. Adicione suporte para manter o SHA do commit de merge e, em seguida, verifique se pull_request_read com o método get expõe merge_commit_sha para pull requests mesclados.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Go
Estrelas
33.1k
Forks
5k
Merge médio
2d 15h
PRs com merge (30d)
27

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de github/github-mcp-server

Todas as issues de github/github-mcp-server

Issues semelhantes

Mais issues de Go

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.