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

Proposal: Make preview features configurable

Aberta
#999 17 comentários 1 reação 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
25/100
Tipo de issue
Funcionalidade
Clareza
Precisa de esclarecimento
Status de atividade
Estagnada
Stack de tecnologia
go
Domínio
api

Direção de pesquisa

Comece rastreando como os cabeçalhos Accept de preview padrão e ListOptions são tratados; a issue não nomeia arquivos nem testes. Defina a API de RequestOptions e determine como as novas APIs devem lidar com cabeçalhos de preview; em seguida, verifique se as requisições para listar repositórios podem omitir o cabeçalho indesejado.

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

Descrição

NeedsInvestigation

Problem

A project I'm working on has an issue where a list of repos is returning a Server Error due to an additional Accept header being added (The "mediaTypeCodesOfConductPreview" header).

Removing this header fixes the problem but I can't do this with the current library implementation.

Solution

Instead of adding these headers by default, we could move them to an Options parameter similar to ListOptions.

type RequestOptions {
  acceptHeaders []string
}
Pros
  • Allows developers to control which headers to add (including headers the library may not control)
  • Removes the maintenance of adding / removing headers from library owners
  • Opens the door for any additional request options in the future.
  • This will remove the need for comments like // TODO: remove custom Accept headers when APIs fully launch.
Cons
  • Forces users to care about headers
    • While a con, users should know if a feature they are using is preview or not and subject to change

Concerns

The only major concern I have with this is approach is that it gets fuzzy what to do with entirely new API's (for example the checks API).

For consistency the API could still require the developer to add the header.
For a sane API the API could add the header with the expectation that the header is removed as soon as possible, but again moves the burden on to the library.

Linguagem predominante
Go
Estrelas
11.3k
Forks
2.6k
Merge médio
2d 8h
PRs com merge (30d)
38

Preparar o ambiente

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 google/go-github

Todas as issues de google/go-github

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.