ListLabelsOutput drops every label id from the typed response
Les mainteneurs répondent en général sous 4 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 1/5
- Temps estimé
- Moins d'une heure
- Accessibilité débutants
- 88/100
Piste de recherche
Ouvre pkg/github/typed_governance_outputs.go et lis MinimalLabel vers la ligne 16 ainsi que le site de décodage autour de la ligne 461 qui remplit ListLabelsOutput. Ajoute un champ ID int64 avec le tag json:"id" à MinimalLabel afin que l'identité héritée survive au décodage et au réencodage, et vérifie si le schéma de sortie a besoin du même champ. Ajoute ensuite un test aller-retour (comme le TestListLabelsDropsID signalé) affirmant que id est préservé et exécute go test ./pkg/github.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
ListLabelsOutput drops every label id from the typed response
Summary
The legacy list_label producer serializes each label's id, but the typed ListLabelsOutput decodes into MinimalLabel, which has no id field. A round-trip through the typed output therefore removes every label id.
Location
- Repository:
github/github-mcp-server - File:
pkg/github/typed_governance_outputs.go - Line: 16 (
MinimalLabel; decode at 461) - Revision:
e3809fe91c75
Affected code
type MinimalLabel struct {
Name string `json:"name"`
Color string `json:"color" jsonschema:"Hex RGB without leading #."`
Description string `json:"description"`
}
type ListLabelsOutput struct {
Labels []MinimalLabel `json:"labels"`
TotalCount int `json:"totalCount" jsonschema:"Total labels in the repository."`
PageInfo MinimalPageInfo `json:"pageInfo"`
}
The legacy JSON carries id, but the typed struct has no destination for it.
Expected behavior
A typed ListLabelsOutput preserves the legacy label identity. Round-tripping:
{"labels":[{"id":123,"name":"bug","color":"ff0000","description":""}],"totalCount":1,"pageInfo":{}}
must keep id: 123, or the typed output must not be used for a lossless interpretation of the legacy response.
Actual behavior
Running a round-trip test in Docker:
docker run --rm -v "$PWD:/app" -v /tmp/gomod:/go/pkg/mod -v /tmp/gocache:/root/.cache/go-build -w /app -e GOFLAGS=-mod=mod golang:1.26 bash -c 'go mod download && go test ./pkg/github -run TestListLabelsDropsID -v'
Observed:
roundtrip={"labels":[{"name":"bug","color":"ff0000","description":""}],"totalCount":1,"pageInfo":{"hasNextPage":false,"hasPreviousPage":false}}
--- PASS: TestListLabelsDropsID
id is gone after the typed decode/encode.
Root cause
MinimalLabel declares only name, color, and description. encoding/json silently ignores the legacy id field, and re-encoding the typed value emits no id.
The current default branch still has the same MinimalLabel definition.
Suggested fix
Add the identity field to the typed model:
type MinimalLabel struct {
ID int64 `json:"id"`
Name string `json:"name"`
Color string `json:"color" jsonschema:"Hex RGB without leading #."`
Description string `json:"description"`
}
and include it in the output schema. Add a round-trip test asserting id survives.
- Langage dominant
- Go
- Étoiles
- 34.4k
- Forks
- 5.3k
- Merge moyen
- 4 j 1 h
- PR mergées (30 j)
- 30
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de github/github-mcp-server
-
create_or_update_file rejects explicitly empty file contentPeut-être pris @Elon-Jiang l’a pris il y a 4 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
github/github-mcp-server#3883 ·
Les mainteneurs répondent en général sous 4 jours
-
csv_output silently overwrites distinct fields when flattened keys collidePeut-être pris @Mystery01092000 l’a pris il y a 5 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
github/github-mcp-server#3865 ·
Les mainteneurs répondent en général sous 4 jours
-
update_issue_labels is annotated destructiveHint: false but replaces (removes) existing labelsPeut-être pris @shhhhhhjokerist l’a pris il y a 12 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 69/100
github/github-mcp-server#3760 · 1 commentaire ·
Les mainteneurs répondent en général sous 4 jours
-
docs(install-claude): "environment variable" examples put the PAT in argv and the saved configPeut-être pris @shhhhhhjokerist l’a pris il y a 12 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
github/github-mcp-server#3758 ·
Les mainteneurs répondent en général sous 4 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 69/100
github/github-mcp-server#3729 ·
Les mainteneurs répondent en général sous 4 jours
Toutes les issues de github/github-mcp-server
Issues similaires
-
otelc go test fails for .go file targets with 'multiple packages found for file targets'Peut-être pris @Aryanbhargava18 l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
open-telemetry/opentelemetry-go-compile-instrumentation#1877 ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug]: Hybrid search silently caps the BM25 candidate pool at 20 even with a higher --limitPeut-être pris @aloneangel45 l’a pris aujourd’hui. Ouvertebug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 84/100
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
channel/http: constructRequest produces double slashes when baseAddress or HTTPEndpoint BaseURL has a trailing slashPeut-être pris @patelshivani2283-lab l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 Une demi-journée Accessibilité débutants 74/100
Les mainteneurs répondent en général sous 1 jour