Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Feature: allow review comments on any file line, not just lines within the diff

Aberta
#2,495 0 comentários 2 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
48/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Pouca atividade
Stack de tecnologia
go, graphql
Domínio
api, backend

Direção de pesquisa

Comece lendo os entry points add_comment_to_pending_review e pull_request_review_write e, em seguida, reproduza o workflow de revisão pendente descrito na issue com um comentário fora do diff. Rastreie como submit_pending trata esses comentários e como a mutação GraphQL addPullRequestReviewThread aceita path e line. Está concluído quando a falha for exposta ou os comentários em linhas arbitrárias de arquivos forem preservados inline, mantendo disponível a solução alternativa existente em nível de arquivo.

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

Descrição

Describe the feature or problem you'd like to solve

When using add_comment_to_pending_review to leave a code review, the comment is silently dropped at submit time if the targeted line is outside the PR's diff hunks (e.g., unchanged context further up the file). The tool returns success on add_comment_to_pending_review, but pull_request_review_write { method: "submit_pending" } accepts the review without that comment ever appearing on the PR.

This means agents reviewing PRs cannot leave inline comments on file context that is relevant to a change but happens to sit outside the modified lines — for example, stale JSDoc on an exported interface that should be updated to reflect a new feature added several lines below.

In the GitHub web UI, a human reviewer can expand context and click any line in any file to add a comment. Agents using this MCP server cannot match that capability.

Proposed solution

Two parts:

  1. Surface the failure. When a comment is dropped because the targeted line is outside the diff, return an error from add_comment_to_pending_review (or surface it on submit) so the agent can fall back to subjectType: "FILE" or a top-level comment. Today the tool reports success and the rejection happens silently inside GitHub's submit step.

  2. Support arbitrary file lines. Use the GraphQL addPullRequestReviewThread mutation (which accepts path + line without requiring a diff position) when the requested line is outside the unified diff. This would give agent reviewers the same expressive power as human reviewers in the UI.

Example prompts or workflows (for tools/toolsets only)
  1. "Review this PR — flag any stale JSDoc/comments on exported APIs whose contract changed." Today the agent can correctly identify stale documentation but cannot leave the inline comment if the JSDoc itself isn't in the diff.
  2. "Suggest renames for the helper functions used by the new code." If the helpers themselves are unchanged, the agent can't comment on them inline.
  3. "Note any security-relevant invariants the changes rely on." Often these are documented elsewhere in the file, outside the diff.
Additional context

Repro:

  1. Open any PR with a small, localized diff.
  2. Use pull_request_review_write { method: "create" } to start a pending review.
  3. Use add_comment_to_pending_review targeting an unchanged line ≥30 lines from the diff. Tool returns success.
  4. Use pull_request_review_write { method: "submit_pending" }. Review submits without the comment.
  5. Verify on the PR — the comment is missing.

Workaround today: use subjectType: "FILE" for file-level comments, or post a top-level issue comment with a permalink. Both lose the inline-thread experience.

Related but distinct: #1748 (fork-PR auth scope) — same symptom (comment doesn't post) but a different root cause.

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

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.