ListLabelsOutput drops every label id from the typed response
Maintainer antworten meist innerhalb von 4 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 1/5
- Geschätzter Aufwand
- Unter einer Stunde
- Anfängerfreundlichkeit
- 88/100
Rechercherichtung
Öffne pkg/github/typed_governance_outputs.go und lies MinimalLabel bei Zeile 16 sowie die Decode-Stelle um Zeile 461, die ListLabelsOutput füllt. Füge MinimalLabel ein Feld ID int64 mit dem Tag json:"id" hinzu, damit die Legacy-Identität Decode und Re-Encode übersteht, und prüfe, ob das Output-Schema dasselbe Feld braucht. Dann füge einen Round-Trip-Test hinzu (wie das gemeldete TestListLabelsDropsID), der prüft, dass id erhalten bleibt, und führe go test ./pkg/github aus.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Go
- Sterne
- 34.4k
- Forks
- 5.3k
- Ø Merge
- 4 T. 1 Std.
- Gemergte PRs (30 T.)
- 30
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus github/github-mcp-server
-
create_or_update_file rejects explicitly empty file contentEvtl. vergeben @Elon-Jiang hat das vor 4 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
github/github-mcp-server#3883 ·
Maintainer antworten meist innerhalb von 4 Tagen
-
csv_output silently overwrites distinct fields when flattened keys collideEvtl. vergeben @Mystery01092000 hat das vor 5 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
github/github-mcp-server#3865 ·
Maintainer antworten meist innerhalb von 4 Tagen
-
update_issue_labels is annotated destructiveHint: false but replaces (removes) existing labelsEvtl. vergeben @shhhhhhjokerist hat das vor 12 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 69/100
github/github-mcp-server#3760 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 4 Tagen
-
docs(install-claude): "environment variable" examples put the PAT in argv and the saved configEvtl. vergeben @shhhhhhjokerist hat das vor 12 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
github/github-mcp-server#3758 ·
Maintainer antworten meist innerhalb von 4 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 69/100
github/github-mcp-server#3729 ·
Maintainer antworten meist innerhalb von 4 Tagen
Alle Issues in github/github-mcp-server
Ähnliche Issues
-
otelc go test fails for .go file targets with 'multiple packages found for file targets'Evtl. vergeben @Aryanbhargava18 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
open-telemetry/opentelemetry-go-compile-instrumentation#1877 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: Hybrid search silently caps the BM25 candidate pool at 20 even with a higher --limitEvtl. vergeben @aloneangel45 hat das heute übernommen. Offenbug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 84/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
channel/http: constructRequest produces double slashes when baseAddress or HTTPEndpoint BaseURL has a trailing slashEvtl. vergeben @patelshivani2283-lab hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 1 Tag