`plugin install` fails on repos that use Git LFS: the whole repo's LFS content is downloaded, and one missing object aborts the install
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
調査の方向性
Start at the plugin-install path that builds the GitHub clone command, and reproduce the Git LFS checkout failure using the command and repository layout in the issue. Trace how the plugin path and cache directory are handled. Done means unrelated LFS objects do not abort installation, plugin-path LFS content remains available, and the existing installation flow still works.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
When a marketplace plugin uses a github source with a path inside a larger repo, copilot plugin install
runs git clone --depth 1 --progress --branch <ref> <url> <cache>/marketplaces/<owner>--<repo> with Git LFS
smudge turned on. Every LFS-tracked file in the repo gets downloaded, including files far outside the
plugin's path. If any one of those objects can't be fetched (for example batch response: Not Found
for an object that was pushed late or never pushed), checkout fails and the install is aborted:
Failed to install plugin: Error: Request plugins.install failed with message: Failed to fetch GitHub plugin <owner>/<repo>: Command failed: git clone --depth 1 --progress --branch main https://github.com/<owner>/<repo> ...\marketplaces\<owner>--<repo>
...
Receiving objects: 100% (29260/29260), 223.35 MiB | 9.17 MiB/s, done.
Downloading <unrelated-data-dir>/.../file.tsv (86 KB)
Error downloading object: ... Smudge error: ... batch response: Not Found
error: external filter 'git-lfs filter-process' failed
fatal: ...: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
The plugin directory itself contains no LFS files and is about 1.2 MB, but the install downloads about
223 MB of pack data plus every LFS object in the repo, and then fails.
Affected version
Observed on Windows; the clone command is unchanged as of GitHub Copilot CLI 1.0.88.
Steps to reproduce the behavior
- Register a marketplace plugin with
{"source":"github","repo":"<owner>/<repo>","path":"plugins/<name>","ref":"main"}
where the repo tracks unrelated files with Git LFS (<data-dir>/** filter=lfs). - Make one LFS object under
<data-dir>unavailable on the server (or just use a large LFS data set). - Run
copilot plugin install <name>@<marketplace>. - The install downloads all LFS content, then fails at checkout with
smudge filter lfs failed.
Expected behavior
- The plugin fetch shouldn't run the LFS smudge for content outside the plugin
path. At minimum,
setGIT_LFS_SKIP_SMUDGE=1for the clone, thengit lfs pull --include "<path>/**"only when the
plugin path actually contains LFS pointers. - A failure to download content outside the plugin
pathshouldn't fail the install. - Ideally, combine this with a partial clone plus sparse checkout of
path(#2399), so only the plugin's files are downloaded.
Additional context
- Workaround: set
GIT_LFS_SKIP_SMUDGE=1beforecopilot plugin install, and delete the half-cloned
marketplaces/<owner>--<repo>directory first. - Related: the cache directory is keyed only by
<owner>--<repo>. Two plugins from the same repo on
differentrefs look like they share one checkout, so the cache key should probably include the ref. - OS: Windows 11 (also affects macOS/Linux, because the clone behavior is the same)
- 主要言語
- Shell
- スター
- 11.2k
- フォーク
- 1.9k
- 平均マージ
- 17時間 6分
- マージ済み PR(30日)
- 5
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/copilot-cli のほかの issue
-
triage
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
github/copilot-cli#4963 ·
メンテナーはふだん 1 日以内に返信
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
github/copilot-cli#4932 ·
メンテナーはふだん 1 日以内に返信
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
github/copilot-cli#4909 ·
メンテナーはふだん 1 日以内に返信
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
github/copilot-cli#4906 ·
メンテナーはふだん 1 日以内に返信
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
github/copilot-cli#4848 ·
メンテナーはふだん 1 日以内に返信
github/copilot-cli の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
YosysHQ/oss-cad-suite-build#216 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
ekalinin/github-markdown-toc#167 ·
-
out-of-date
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
CachyOS/CachyOS-PKGBUILDS#1917 ·
メンテナーはふだん 1 日以内に返信
-
package-update
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信