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

`gh pr edit --title` fails when a team reviewer is inaccessible to the token

Aberta
#14,317 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

  • #14315 de @timrogers — fechado sem integrar

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
68/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
github, go
Domínio
api, cli

Direção de pesquisa

Comece pelo comando gh pr edit e rastreie a busca inicial da pull request antes da mutação PullRequestUpdate. Use a reprodução fornecida com um reviewer de equipe e um token limitado para verificar que a substituição do título não lê mais reviewRequests, enquanto a atualização continua sendo concluída. Está concluído quando o título muda sem o erro de reviewer proibido e os testes existentes passam.

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

Descrição

auth bug gh-pr priority-3
Describe the bug

gh pr edit --title can fail before performing the update because its initial pull request lookup fetches reviewRequests even though the current reviewers are not needed to replace the title.

This is reproducible when the pull request has a requested team reviewer and the token can update pull requests but cannot resolve that reviewer. The GraphQL response contains the pull request data plus a FORBIDDEN error at:

repository.pullRequest.reviewRequests.nodes.0.requestedReviewer

This is the same general over-fetching problem previously reported in #8784 for projectCards, but the reviewer path remains reproducible in the latest release.

Affected version
gh version 2.99.0 (2026-09-01)
https://github.com/cli/cli/releases/tag/v2.99.0
Steps to reproduce the behavior
  1. Use a token that has permission to write pull requests in an organization repository but cannot resolve a requested team reviewer.

  2. Choose a pull request authored by the authenticated user that has a team review request.

  3. Run:

    GH_TOKEN="$TOKEN" gh pr edit <number> --repo <owner/repo> --title "<current title>"
    
  4. Observe that the command exits before updating the pull request.

I also reproduced this with GH_DEBUG=api. The lookup requested reviewRequests(first: 100) and attempted to resolve user, bot, team, and team organization details.

Expected vs actual behavior

Expected: replacing the title should require only enough pull request data to identify the pull request and print its URL. The command should perform the update without reading reviewers.

Actual: the command exits non-zero while resolving an unrelated team reviewer:

GraphQL: Resource not accessible by personal access token (repository.pullRequest.reviewRequests.nodes.0.requestedReviewer)

A query for only the pull request id and url succeeds with the same token. A locally patched build that uses that minimal lookup also completes the real PullRequestUpdate mutation end to end.

Logs

The sanitized GraphQL error is:

{
  "type": "FORBIDDEN",
  "path": [
    "repository",
    "pullRequest",
    "reviewRequests",
    "nodes",
    0,
    "requestedReviewer"
  ],
  "extensions": {
    "saml_failure": false
  },
  "locations": [
    {
      "line": 1,
      "column": 211
    }
  ],
  "message": "Resource not accessible by personal access token"
}

Repository and pull request details have been omitted because the reproduction used a private organization repository.

Linguagem predominante
Go
Estrelas
46.7k
Forks
9.2k
Merge médio
3d 15h
PRs com merge (30d)
56

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

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 cli/cli

Todas as issues de cli/cli

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.