ListLabelsOutput drops every label id from the typed response
Maintainer thường phản hồi trong vòng 4 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 88/100
Hướng nghiên cứu
Mở pkg/github/typed_governance_outputs.go và đọc MinimalLabel gần dòng 16 cùng vị trí decode khoảng dòng 461 nơi điền ListLabelsOutput. Thêm trường ID int64 với tag json:"id" vào MinimalLabel để identity legacy tồn tại qua decode và re-encode, và kiểm tra xem schema đầu ra có cần cùng trường đó không. Sau đó thêm một test round-trip (giống TestListLabelsDropsID được báo cáo) khẳng định id được giữ nguyên và chạy go test ./pkg/github.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 34.4k
- Fork
- 5.3k
- Merge trung bình
- 4 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 30
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/github-mcp-server
-
create_or_update_file rejects explicitly empty file contentCó thể đã có người làm @Elon-Jiang đã nhận 4 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
github/github-mcp-server#3883 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
csv_output silently overwrites distinct fields when flattened keys collideCó thể đã có người làm @Mystery01092000 đã nhận 5 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
github/github-mcp-server#3865 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
update_issue_labels is annotated destructiveHint: false but replaces (removes) existing labelsCó thể đã có người làm @shhhhhhjokerist đã nhận 12 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
github/github-mcp-server#3760 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
docs(install-claude): "environment variable" examples put the PAT in argv and the saved configCó thể đã có người làm @shhhhhhjokerist đã nhận 12 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
github/github-mcp-server#3758 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
github/github-mcp-server#3729 ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của github/github-mcp-server
Issue tương tự
-
otelc go test fails for .go file targets with 'multiple packages found for file targets'Có thể đã có người làm @Aryanbhargava18 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
open-telemetry/opentelemetry-go-compile-instrumentation#1877 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Hybrid search silently caps the BM25 candidate pool at 20 even with a higher --limitCó thể đã có người làm @aloneangel45 đã nhận hôm nay. Đang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
channel/http: constructRequest produces double slashes when baseAddress or HTTPEndpoint BaseURL has a trailing slashCó thể đã có người làm @patelshivani2283-lab đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày