create_or_update_file rejects explicitly empty file content
Los mantenedores suelen responder en 4 días
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- github, go
- Área
- backend-api-design
Línea de trabajo
Empieza en CreateOrUpdateFile(...).Handler(...) y compara cómo gestiona una cadena de contenido explícitamente vacía con push_files; el issue informa de dos casos de regresión que fallan y de casos de creación y actualización con contenido no vacío que pasan. Añade pruebas para el contenido vacío al crear y actualizar, conservando el rechazo del contenido ausente o null y las protecciones indicadas para SHA y symlink. El trabajo estará listo cuando esos casos pasen por el cliente go-github real sin un error prematuro por falta de contenido.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
create_or_update_file rejects an explicitly supplied empty string with missing required parameter: content, preventing agents from creating empty package markers such as __init__.py / .gitkeep, or intentionally clearing an existing file.
The tool schema requires a string but does not impose a minimum length. The GitHub Contents API accepts empty base64 content, and push_files already distinguishes absent content from an explicitly empty string.
Reproduction
Call the tool with {"owner":"owner","repo":"repo","path":"__init__.py","branch":"main","message":"Add package marker","content":""}. Expected: a Contents API request with content: "". Actual: the tool returns an error before making any HTTP request. Updating an existing ordinary file with its current SHA fails in the same way.
Reproduced at 4e6e6c053e48aac182f7768162fef2ad42fe7d5f through CreateOrUpdateFile(...).Handler(...), using the real go-github REST client with a controlled HTTP transport. Two new regression cases fail; existing nonempty create/update cases pass. No live repository write was performed in reproduction.
I plan to allow explicitly empty content while continuing to reject absent/null content, preserving the existing exported Go input type, JSON schema, SHA validation and symlink protections. I checked the complete open PR file lists and relevant closed PRs; #3313 (binary encoding) and #2772 (GraphQL migration) retain the empty-string rejection and address different behavior.
This report and proposed fix were prepared with AI assistance.
- Lenguaje dominante
- Go
- Estrellas
- 34.4k
- Forks
- 5.3k
- Merge medio
- 4 d 12 h
- PR fusionados (30 d)
- 13
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
-
csv_output silently overwrites distinct fields when flattened keys collidePosiblemente ocupada @Mystery01092000 la tomó hace 1 día. 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 8 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 8 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
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
github/github-mcp-server#3722 ·
Los mantenedores suelen responder en 4 días
Todos los issues de github/github-mcp-server
Issues similares
-
agent-review-finding chore
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
jordansmall/spindrift#7254 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
pg-sharding/spqr#3275 ·
Los mantenedores suelen responder en 1 día
-
feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
databricks/terraform-provider-databricks#6210 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
IBM-Cloud/terraform-provider-ibm#7115 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
fluxcd/notification-controller#1441 ·
Los mantenedores suelen responder en 1 día