csv_output silently overwrites distinct fields when flattened keys collide
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 84/100
Direção de pesquisa
Leia pkg/github/csv_output.go, especialmente appendFlattenedCSVFields e csvColumnName, e depois revise os testes de achatamento em pkg/github/csv_output_test.go. Adicione a linha JSON relatada com uma chave que contenha um ponto literal e o caminho aninhado equivalente. O trabalho estará concluído quando a saída for determinística e preservar ambos os valores, ou informar claramente que a linha não pode ser representada sem perda.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Summary
When csv_output is enabled, list-tool results are converted to CSV by flattening nested objects with .-joined column names. A literal field name containing . can produce the same column name as a nested field. One value is silently overwritten; Go map iteration makes the surviving value unpredictable.
Reproduction (from the current implementation)
Convert a list response containing this JSON row through jsonTextToCSV:
[{"user.login":"literal","user":{"login":"nested"}}]
appendFlattenedCSVFields maps both the top-level user.login and the nested user → login to the same row["user.login"]. The resulting CSV has only one user.login column, containing either literal or nested, depending on map iteration order. The other value is lost.
The conversion is used by withCSVOutput for default list_* tools whenever the csv_output feature flag is enabled (including insiders mode). This is a code-path demonstration, not a claim of a live GitHub API response with these exact fields.
Expected behavior
Distinct JSON fields remain distinguishable in CSV, or the conversion explicitly reports that it cannot represent this row without loss. The chosen output should be deterministic.
Suggested fix
Escape/encode path components when building flattened column names, or detect collisions and use unambiguous names/fail clearly. Add a regression test with both a literal dotted key and an equivalent nested path (and verify neither value is silently dropped).
Source
pkg/github/csv_output.go:appendFlattenedCSVFields,csvColumnName,csvRowsFromArray, andwithCSVOutput.pkg/github/csv_output_test.go: existing flattening tests cover nested objects, but not colliding flattened names.
- Linguagem predominante
- Go
- Estrelas
- 34.4k
- Forks
- 5.3k
- Merge médio
- 3d 10h
- PRs com merge (30d)
- 11
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
-
update_issue_labels is annotated destructiveHint: false but replaces (removes) existing labelsTalvez já em andamento @shhhhhhjokerist assumiu há 6 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é 2 dias
-
docs(install-claude): "environment variable" examples put the PAT in argv and the saved configTalvez já em andamento @shhhhhhjokerist assumiu há 6 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
github/github-mcp-server#3758 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 69/100
github/github-mcp-server#3729 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
github/github-mcp-server#3722 ·
Mantenedores costumam responder em até 2 dias
-
Insiders Feedback: PR created UI doesn't link to the PRTalvez já em andamento @genius-0963 assumiu há 12 dias. Abertabug insiders user-experience
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
github/github-mcp-server#3658 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de github/github-mcp-server
Issues semelhantes
-
kind/features
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
TencentBlueKing/bk-nodemgr#4017 ·
Mantenedores costumam responder em até 1 dia
-
ssa: wait errors drop the kstatus message, so health check failures don't say whyTalvez já em andamento @schdief assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
equinor/radix-operator#2066 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
microsoft/terraform-provider-msgraph#188 · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
Mantenedores costumam responder em até 2 dias