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

Aperta Adatta ai principianti
#757 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@yutianjiang39 ci sta già lavorando.

Dal 30/11/2026.

  • #790 di @yutianjiang39 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
84/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
cli

Direzione di ricerca

Inizia da lean/commands/cloud/push.py e segui come viene gestito il valore restituito da PushManager.push_projects; l’issue afferma che il metodo restituisce già False quando un push non riesce. Controlla i test esistenti per lean cloud push, poi verifica che i push di progetti o librerie non riusciti producano un codice di uscita diverso da zero dopo aver tentato tutti gli elementi richiesti, mantenendo i messaggi di avviso.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
335
Fork
172
Merge medio
6h 54m
PR unite (30g)
37

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di QuantConnect/lean-cli

Tutte le issue di QuantConnect/lean-cli

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.