An empty sanitized parent component gives cloud push a destination outside the workspace
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 75/100
Hướng nghiên cứu
Chạy đoạn tái hiện trước để thấy get_local_project_path trả về /Strategy. Sau đó đọc _format_local_path trong trình quản lý dự án (lean/components/project_manager.py hoặc tương tự), nơi : được thay thế và loại bỏ, và lời gọi relative_to(Path.cwd()) trong PushManager._push_project sử dụng nó. Hoàn thành nghĩa là một component đã được làm sạch rỗng nhận được tên cục bộ dùng được (hoặc một lỗi xác thực rõ ràng) và một test bao phủ :/Strategy chạy qua.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 335
- Fork
- 172
- Merge trung bình
- 6 giờ 54 phút
- Pull request đã merge (30 ngày)
- 37
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của QuantConnect/lean-cli
-
priority:P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
QuantConnect/lean-cli#792 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
priority:P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
QuantConnect/lean-cli#786 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
priority:P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
QuantConnect/lean-cli#785 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A partially written live command result aborts polling with JSONDecodeErrorCó thể đã có người làm @pcbeingused333 đã nhận 3 ngày trước. Đang mởpriority:P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
QuantConnect/lean-cli#784 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Container lookup failures during result polling are masked by UnboundLocalErrorCó thể đã có người làm @pcbeingused333 đã nhận 5 ngày trước. Đang mởpriority:P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
QuantConnect/lean-cli#783 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của QuantConnect/lean-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
pimutils/vdirsyncer#1242 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
open-webui/open-webui#35360 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Suggest link: Destiny Verify (MIT zero-dependency pre-commit security, citation & link hygiene CLI)Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày