ListLabelsOutput drops every label id from the typed response
Mantenedores costumam responder em até 4 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 1/5
- Tempo estimado
- Menos de uma hora
- Facilidade para iniciantes
- 88/100
Direção de pesquisa
Abra pkg/github/typed_governance_outputs.go e leia MinimalLabel perto da linha 16, além do ponto de decodificação por volta da linha 461 que preenche ListLabelsOutput. Adicione um campo ID int64 com a tag json:"id" a MinimalLabel para que a identidade legada sobreviva à decodificação e recodificação, e verifique se o schema de saída precisa do mesmo campo. Em seguida, adicione um teste de ida e volta (como o TestListLabelsDropsID relatado) afirmando que id é preservado e execute go test ./pkg/github.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Go
- Estrelas
- 34.4k
- Forks
- 5.3k
- Merge médio
- 4d 1h
- PRs com merge (30d)
- 30
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de github/github-mcp-server
-
create_or_update_file rejects explicitly empty file contentTalvez já em andamento @Elon-Jiang assumiu há 4 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
github/github-mcp-server#3883 ·
Mantenedores costumam responder em até 4 dias
-
csv_output silently overwrites distinct fields when flattened keys collideTalvez já em andamento @Mystery01092000 assumiu há 5 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
github/github-mcp-server#3865 ·
Mantenedores costumam responder em até 4 dias
-
update_issue_labels is annotated destructiveHint: false but replaces (removes) existing labelsTalvez já em andamento @shhhhhhjokerist assumiu há 12 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 69/100
github/github-mcp-server#3760 · 1 comentário ·
Mantenedores costumam responder em até 4 dias
-
docs(install-claude): "environment variable" examples put the PAT in argv and the saved configTalvez já em andamento @shhhhhhjokerist assumiu há 12 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
github/github-mcp-server#3758 ·
Mantenedores costumam responder em até 4 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 69/100
github/github-mcp-server#3729 ·
Mantenedores costumam responder em até 4 dias
Todas as issues de github/github-mcp-server
Issues semelhantes
-
otelc go test fails for .go file targets with 'multiple packages found for file targets'Talvez já em andamento @Aryanbhargava18 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
open-telemetry/opentelemetry-go-compile-instrumentation#1877 ·
Mantenedores costumam responder em até 1 dia
-
[Bug]: Hybrid search silently caps the BM25 candidate pool at 20 even with a higher --limitTalvez já em andamento @aloneangel45 assumiu hoje. Abertabug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
channel/http: constructRequest produces double slashes when baseAddress or HTTPEndpoint BaseURL has a trailing slashTalvez já em andamento @patelshivani2283-lab assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 Meio dia Facilidade para iniciantes 74/100
Mantenedores costumam responder em até 1 dia