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

Offen Anfängerfreundlich
#757 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@yutianjiang39 arbeitet bereits daran.

Seit 30.11.2026.

  • #790 von @yutianjiang39 — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
84/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
cli

Rechercherichtung

Beginne in lean/commands/cloud/push.py und verfolge, wie der Rückgabewert von PushManager.push_projects behandelt wird; laut Issue gibt diese Methode bereits False zurück, wenn ein Push fehlschlägt. Prüfe die vorhandenen Tests für lean cloud push und verifiziere anschließend, dass fehlgeschlagene Pushes von Projekten oder Bibliotheken nach dem Versuch aller angeforderten Elemente zu einem Exit-Code ungleich null führen, während die Warnmeldungen erhalten bleiben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Python
Sterne
335
Forks
172
Ø Merge
6 Std. 54 Min.
Gemergte PRs (30 T.)
37

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus QuantConnect/lean-cli

Alle Issues in QuantConnect/lean-cli

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.