An empty sanitized parent component gives cloud push a destination outside the workspace
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
まず再現用スニペットを実行して、get_local_project_path が /Strategy を返すことを確認します。次に、プロジェクトマネージャ(lean/components/project_manager.py など)内の _format_local_path を読みます。ここでは : が置換され、除去されます。また、それを使用する PushManager._push_project 内の relative_to(Path.cwd()) 呼び出しも読みます。完了条件は、空のサニタイズ済みコンポーネントが使用可能なローカル名を取得する(または明確な検証エラーになる)ことと、:/Strategy をカバーするテストが通ることです。
索引モデルが issue の本文から書いたものです。
説明
Problem
A Linux directory component that becomes empty during project-name sanitization can make the computed destination absolute and outside the workspace. Bulk push then fails before uploading the project.
Reproduction
On master at 39a4d2f, using the real project manager and a fresh temporary working directory:
import os
import tempfile
from pathlib import Path
from lean.container import container
root = Path(tempfile.mkdtemp())
os.chdir(root)
project = root / ":" / "Strategy"
project.mkdir(parents=True)
(project / "config.json").write_text(
'{"algorithm-language":"Python","cloud-id":20}'
)
(project / "main.py").write_text("# source\n")
destination = container.project_manager.get_local_project_path(
":/Strategy", cloud_id=20, source_path=project
)
print(destination) # /Strategy, outside root
_format_local_path replaces : with a space and strips it, producing /Strategy. Joining that value to Path.cwd() discards the workspace. PushManager._push_project subsequently calls destination.relative_to(Path.cwd()), which raises ValueError, so lean cloud push cannot push this discovered project.
The sanitized destination must stay inside the workspace. Handle components that sanitize to an empty string explicitly, with a usable local name or a clear validation error rather than computing an absolute destination.
- 主要言語
- Python
- スター
- 335
- フォーク
- 172
- 平均マージ
- 6時間 54分
- マージ済み PR(30日)
- 37
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
QuantConnect/lean-cli のほかの issue
-
priority:P2
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
QuantConnect/lean-cli#792 ·
メンテナーはふだん 1 日以内に返信
-
priority:P2
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
QuantConnect/lean-cli#786 ·
メンテナーはふだん 1 日以内に返信
-
priority:P2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
QuantConnect/lean-cli#785 ·
メンテナーはふだん 1 日以内に返信
-
A partially written live command result aborts polling with JSONDecodeError対応中かも @pcbeingused333 が 3 日前に担当しました。 オープンpriority:P2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
QuantConnect/lean-cli#784 ·
メンテナーはふだん 1 日以内に返信
-
Container lookup failures during result polling are masked by UnboundLocalError対応中かも @pcbeingused333 が 5 日前に担当しました。 オープンpriority:P2
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
QuantConnect/lean-cli#783 ·
メンテナーはふだん 1 日以内に返信
QuantConnect/lean-cli の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pimutils/vdirsyncer#1242 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
open-webui/open-webui#35360 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
Suggest link: Destiny Verify (MIT zero-dependency pre-commit security, citation & link hygiene CLI)オープン
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信