Repository navigation
Exit nonzero when a cloud push fails - #790
Open
yutianjiang39 wants to merge 1 commit into
Open
yutianjiang39 wants to merge 1 commit into
yutianjiang39 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #757.
lean cloud pushnow exits nonzero if any requested project or library fails to push. Inlean 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_projectsloop, per-project warning text, and--forcehint are unchanged. The built-in--pushpaths forlean cloud backtest,lean cloud optimize, andlean cloud live deploystill useCloudProjectManagerandPushFailedErroras before. Any changes to those paths or to batch processing and warnings would be separate follow-up work.Testing
d38d975with 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--forcehint, and the nonzero exit status.tests/commands/cloud/test_push.pyandtests/components/util/test_push_manager.pyreported 76 passed, 3 skipped on Linux. The skipped cases require macOS. These tests use a mocked cloud API.