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

オープン 初心者向け
#757 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@yutianjiang39 がすでに取り組んでいます。

2026年11月30日 から。

  • #790 @yutianjiang39 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
84/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
cli

調査の方向性

lean/commands/cloud/push.pyから始め、PushManager.push_projectsの戻り値がどのように処理されるかを追ってください。issueによると、このメソッドはpushが失敗した場合にすでにFalseを返します。lean cloud pushの既存テストを確認し、要求されたすべての項目を試行した後、プロジェクトまたはライブラリのpushが失敗すると終了コードが0以外になり、警告メッセージが維持されることを検証してください。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
335
フォーク
172
平均マージ
6時間 54分
マージ済み PR(30日)
37

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

QuantConnect/lean-cli のほかの issue

QuantConnect/lean-cli の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。