lean cloud push exits 0 when a project can't be pushed

Đang mở Phù hợp với người mới
#757 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@yutianjiang39 đang làm issue này rồi.

Từ ngày 30/11/2026.

  • #790 của @yutianjiang39 — đang mở

Đá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
84/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu ở lean/commands/cloud/push.py và theo dõi cách giá trị trả về của PushManager.push_projects được xử lý; issue cho biết phương thức này đã trả về False khi một lần push thất bại. Kiểm tra các bài kiểm thử hiện có cho lean cloud push, sau đó xác minh rằng các lần push dự án hoặc thư viện thất bại sẽ tạo ra mã thoát khác 0 sau khi đã thử tất cả các mục được yêu cầu, đồng thời giữ lại các thông báo cảnh báo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

priority:P2

Problem

lean cloud push exits 0 when it could not push a project. It prints a warning such as:

[1/1] Pushing 'Example'
Cannot push 'Example': The project could not be saved as another collaborator 
controls the write permission. Request write permission from your collaborator 
#CbnquaQ7LCY6
Please pull any required changes and push with --force

and then returns success. Scripts and CI that chain commands on its exit status, such as lean cloud push --project Example && lean cloud backtest Example, then backtest the cloud's previous files and report that as a result for the local changes.

#718 made lean cloud backtest/optimize/live deploy --push stop with exit code 1 in this case. That PR intentionally kept lean cloud push itself unchanged, so this is still the behavior in 1.0.234.

Reproduction (1.0.234)

  1. lean create-project Example --language python and lean cloud push --project Example.
  2. Edit main.py in the cloud from another client, such as the web IDE or an MCP client. That client now holds the project's write lock.
  3. Change the local main.py and run lean cloud push --project Example; echo $?.

Observed: the Cannot push warning above, then 0. The cloud file keeps the other client's version.

Expected

When any requested project or library can't be pushed, lean cloud push exits nonzero after it has tried all of them. It keeps the same warnings. PushManager.push_projects already returns False in this case (#718), and lean/commands/cloud/push.py ignores that return value.

This changes the exit status that scripts see for a failed push. That is the reason for the change, but it is still a behavior change for callers.

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của QuantConnect/lean-cli

Tất cả issue của QuantConnect/lean-cli

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.