You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Successful push-induced rename makes cloud backtest report project missing #721
A successful push can rename the local project directory, after which the cloud-project resolver reads config.json from the old path. A command such as lean cloud backtest <name> --push then fails even though the project was uploaded successfully. Backtest reports a misleading project-not-found error.
Reproduction
On Linux:
Create a Python project directory named Unsafe:Project.
Run lean cloud backtest 'Unsafe:Project' --push.
The push sanitizes the local name to Unsafe Project, creates/updates the cloud project and writes its cloud ID under the new directory. The resolver subsequently reads the old Unsafe:Project/config.json, finds no cloud ID and raises Something went wrong while pushing the project to the cloud. The backtest command rewrites that RuntimeError into a project-not-found message.
Evidence
A local probe using the real resolver, push manager, project manager and project configuration, with a mocked successful API, reproduced this on master commit f3deb21:
projects.create returned project ID 20 named Unsafe Project.
get_cloud_project("Unsafe:Project", push=True) nevertheless raised Something went wrong while pushing the project to the cloud.
PushManager._push_project updates only its own project_path after a rename; CloudProjectManager.get_cloud_project retains the original local_path when reading the cloud ID. A cloud-assigned replacement name can trigger the same mismatch.
Expected behavior
The resolver should retain the successfully pushed project's identity across a local rename and continue to compilation, rather than reopening the original path. Add regression coverage for name sanitization and a cloud-assigned replacement name.
Workaround: rerun the command using the resulting local directory name. This is limited to pushes that rename the directory; commands whose paths remain unchanged are unaffected.
Activity
fix: follow the project directory a push renames in cloud commands
Follow the project directory a push renames in cloud commands (QuantC…