Skip to content

Exit nonzero when a cloud push fails - #790

Open
yutianjiang39 wants to merge 1 commit into
QuantConnect:masterfrom
yutianjiang39:contrib/issue-757
Open

yutianjiang39 wants to merge 1 commit into
QuantConnect:masterfrom
yutianjiang39:contrib/issue-757

Conversation

@yutianjiang39

Copy link
Copy Markdown

Fixes #757.

lean cloud push now exits nonzero if any requested project or library fails to push. In lean cloud push --project Example && lean cloud backtest Example, the shell skips the backtest when the push fails, so it cannot run against stale cloud files.

With --project, the exit status includes the project's referenced libraries. Without it, the status covers all projects in the directory. Both paths use the result of the full batch: a failure does not stop later pushes, and a later success does not mask an earlier failure. Successful pushes still exit 0.

The PushManager.push_projects loop, per-project warning text, and --force hint are unchanged. The built-in --push paths for lean cloud backtest, lean cloud optimize, and lean cloud live deploy still use CloudProjectManager and PushFailedError as before. Any changes to those paths or to batch processing and warnings would be separate follow-up work.

Testing

  • On baseline d38d975 with the new regression tests, all three write-lock cases failed because the command exited 0: a locked project, a locked referenced library, and a partially successful directory push. With the patch applied, all three passed. They check which updates were attempted, the warning and --force hint, and the nonzero exit status.
  • With the patch applied to the same baseline, tests/commands/cloud/test_push.py and tests/components/util/test_push_manager.py reported 76 passed, 3 skipped on Linux. The skipped cases require macOS. These tests use a mocked cloud API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant