ListLabelsOutput drops every label id from the typed response
Los mantenedores suelen responder en 4 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Aptitud para principiantes
- 88/100
Línea de trabajo
Abre pkg/github/typed_governance_outputs.go y lee MinimalLabel cerca de la línea 16, además del punto de decodificación alrededor de la línea 461 que rellena ListLabelsOutput. Añade un campo ID int64 con la etiqueta json:"id" a MinimalLabel para que la identidad heredada sobreviva a la decodificación y recodificación, y comprueba si el esquema de salida necesita el mismo campo. Después añade una prueba de ida y vuelta (como la reportada TestListLabelsDropsID) que afirme que id se conserva y ejecuta go test ./pkg/github.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Go
- Estrellas
- 34.4k
- Forks
- 5.3k
- Merge medio
- 4 d 1 h
- PR fusionados (30 d)
- 30
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de github/github-mcp-server
-
create_or_update_file rejects explicitly empty file contentPosiblemente ocupada @Elon-Jiang la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
github/github-mcp-server#3883 ·
Los mantenedores suelen responder en 4 días
-
csv_output silently overwrites distinct fields when flattened keys collidePosiblemente ocupada @Mystery01092000 la tomó hace 5 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
github/github-mcp-server#3865 ·
Los mantenedores suelen responder en 4 días
-
update_issue_labels is annotated destructiveHint: false but replaces (removes) existing labelsPosiblemente ocupada @shhhhhhjokerist la tomó hace 12 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
github/github-mcp-server#3760 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
docs(install-claude): "environment variable" examples put the PAT in argv and the saved configPosiblemente ocupada @shhhhhhjokerist la tomó hace 12 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
github/github-mcp-server#3758 ·
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
github/github-mcp-server#3729 ·
Los mantenedores suelen responder en 4 días
Todos los issues de github/github-mcp-server
Issues similares
-
otelc go test fails for .go file targets with 'multiple packages found for file targets'Posiblemente ocupada @Aryanbhargava18 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
open-telemetry/opentelemetry-go-compile-instrumentation#1877 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Hybrid search silently caps the BM25 candidate pool at 20 even with a higher --limitPosiblemente ocupada @aloneangel45 la tomó hoy. Abiertobug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
channel/http: constructRequest produces double slashes when baseAddress or HTTPEndpoint BaseURL has a trailing slashPosiblemente ocupada @patelshivani2283-lab la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Medio día Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día