Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Proposal: Make preview features configurable

Offen
#999 17 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
25/100
Issue-Typ
Feature
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
go
Bereich
api

Rechercherichtung

Beginne damit nachzuverfolgen, wie standardmäßige Preview-Accept-Header und ListOptions behandelt werden; das Issue nennt keine Dateien oder Tests. Definiere die RequestOptions-API und kläre, wie neue APIs mit Preview-Headern umgehen sollten, und überprüfe anschließend, dass Requests zum Auflisten von Repositories den unerwünschten Header weglassen können.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Go
Sterne
11.3k
Forks
2.5k
Ø Merge
1 T. 16 Std.
Gemergte PRs (30 T.)
51

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus google/go-github

Alle Issues in google/go-github

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.