ListLabelsOutput drops every label id from the typed response
I maintainer di solito rispondono entro 4 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 88/100
Direzione di ricerca
Apri pkg/github/typed_governance_outputs.go e leggi MinimalLabel verso la riga 16 insieme al punto di decode intorno alla riga 461 che popola ListLabelsOutput. Aggiungi un campo ID int64 con il tag json:"id" a MinimalLabel in modo che l'identità legacy sopravviva a decode e re-encode, e verifica se lo schema di output necessita dello stesso campo. Poi aggiungi un test di round-trip (come il TestListLabelsDropsID segnalato) che asserisca che id è preservato ed esegui go test ./pkg/github.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Go
- Stelle
- 34.4k
- Fork
- 5.3k
- Merge medio
- 4g 1h
- PR unite (30g)
- 30
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di github/github-mcp-server
-
create_or_update_file rejects explicitly empty file contentForse già presa @Elon-Jiang l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
github/github-mcp-server#3883 ·
I maintainer di solito rispondono entro 4 giorni
-
csv_output silently overwrites distinct fields when flattened keys collideForse già presa @Mystery01092000 l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
github/github-mcp-server#3865 ·
I maintainer di solito rispondono entro 4 giorni
-
update_issue_labels is annotated destructiveHint: false but replaces (removes) existing labelsForse già presa @shhhhhhjokerist l’ha presa 12 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
github/github-mcp-server#3760 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
-
docs(install-claude): "environment variable" examples put the PAT in argv and the saved configForse già presa @shhhhhhjokerist l’ha presa 12 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
github/github-mcp-server#3758 ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
github/github-mcp-server#3729 ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di github/github-mcp-server
Issue simili
-
otelc go test fails for .go file targets with 'multiple packages found for file targets'Forse già presa @Aryanbhargava18 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
open-telemetry/opentelemetry-go-compile-instrumentation#1877 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Hybrid search silently caps the BM25 candidate pool at 20 even with a higher --limitForse già presa @aloneangel45 l’ha presa oggi. Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
channel/http: constructRequest produces double slashes when baseAddress or HTTPEndpoint BaseURL has a trailing slashForse già presa @patelshivani2283-lab l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno