create_or_update_file rejects explicitly empty file content
メンテナーはふだん 4 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- github, go
調査の方向性
CreateOrUpdateFile(...).Handler(...)から始め、明示的に空のコンテンツ文字列をpush_filesと比較してどのように処理するか確認してください。issueでは、回帰ケース2件が失敗し、空でないコンテンツでの作成・更新ケースは成功すると報告されています。作成時と更新時の空コンテンツを対象にテストを追加し、コンテンツが未指定またはnullの場合の拒否と、記載されているSHAおよびsymlinkの保護を維持してください。実際のgo-githubクライアントを通したこれらのケースが、コンテンツ不足の早期エラーなしで成功すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Go
- スター
- 34.4k
- フォーク
- 5.3k
- 平均マージ
- 4日 12時間
- マージ済み PR(30日)
- 13
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/github-mcp-server のほかの issue
-
csv_output silently overwrites distinct fields when flattened keys collide対応中かも @Mystery01092000 が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
github/github-mcp-server#3865 ·
メンテナーはふだん 4 日以内に返信
-
update_issue_labels is annotated destructiveHint: false but replaces (removes) existing labels対応中かも @shhhhhhjokerist が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
github/github-mcp-server#3760 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
docs(install-claude): "environment variable" examples put the PAT in argv and the saved config対応中かも @shhhhhhjokerist が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
github/github-mcp-server#3758 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
github/github-mcp-server#3729 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
github/github-mcp-server#3722 ·
メンテナーはふだん 4 日以内に返信
github/github-mcp-server の issue をすべて見る
似ている issue
-
agent-review-finding chore
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
jordansmall/spindrift#7254 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pg-sharding/spqr#3275 ·
メンテナーはふだん 1 日以内に返信
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
databricks/terraform-provider-databricks#6210 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
IBM-Cloud/terraform-provider-ibm#7115 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
fluxcd/notification-controller#1441 ·
メンテナーはふだん 1 日以内に返信