Skip to content

fix(cloud): push project libraries when using --push in cloud commands - #725

Open
pcbeingused333 wants to merge 2 commits into
QuantConnect:masterfrom
pcbeingused333:fix/cloud-push-libraries
Open

pcbeingused333 wants to merge 2 commits into
QuantConnect:masterfrom
pcbeingused333:fix/cloud-push-libraries

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

Fixes #719

lean cloud backtest/optimize/live deploy <project> --push resolves the project through CloudProjectManager.get_cloud_project, which called PushManager.push_projects([local_path]) without the project's libraries. The project itself was pushed, but the libraries it references were not, so the cloud ran against stale or missing library code. lean cloud push does not have this problem because PushManager.push_project passes get_project_libraries(project).

Fix: in both push branches of get_cloud_project (local project directory and cloud name/id resolved to a local directory), pass ProjectManager.get_project_libraries(local_path) as the associated libraries to push_projects, the same way push_project does.

Tests: tests/components/cloud/test_cloud_project_manager.py gets a new test with a project that references a library and asserts the library is passed to push_projects; the three existing push tests now assert the new call shape. All four fail without the change and pass with it.

This change was prepared with the help of an AI assistant (Claude), and the submitter is responsible for it.

@quantconnect-kronos

Copy link
Copy Markdown
Contributor

Thanks @pcbeingused333. Your fix commit is cherry-picked, with your authorship, into #749. That PR adapts the test to the current resolver, which now follows a project directory renamed by the push (#734), and adds tests that run the real push path for a changed library and for a failed library upload.

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.

Cloud commands with --push do not upload referenced libraries

1 participant