Skip to content

Cloud-ID --push skips a project renamed locally #720

Closed

Description

Problem

A cloud command given a project ID and --push can silently skip an existing local copy after its directory is renamed. The local config.json still identifies the same cloud project, but the resolver looks only under the cloud project's current name. It then returns the cloud project without uploading local changes.

Reproduction

  1. Create Example locally and push it, recording its cloud ID.
  2. Rename its local directory to Renamed Example, preserving config.json and its cloud-id.
  3. Edit the local algorithm.
  4. From the workspace root, run lean cloud backtest <cloud-id> --push.

The command can proceed with the older cloud files instead of pushing the local copy. The same resolver serves cloud optimization and live deployment.

Evidence

Reproduced with the real CloudProjectManager, ProjectManager and local configuration handling, using a mocked API, on master commit f3deb21:

  • The cloud project was named Python Project, with ID 20.
  • The local directory was renamed to Renamed Project and retained cloud-id: 20.
  • get_cloud_project("20", push=True) returned the cloud project successfully.
  • projects.update was never called.

In lean/components/cloud/cloud_project_manager.py, the ID/name fallback calls get_local_project_path(cloud_project.name, cloud_project.projectId). That helper searches the cloud name and its numeric-suffix variants, not all local projects with the matching cloud ID. When the guessed path does not exist, the resolver treats the local counterpart as absent.

Expected behavior

An ID-based command with --push should find an existing local project with that cloud ID before deciding that there is no local copy to upload. It must not silently execute outdated files in this case.

Suggestion: resolve the local counterpart by its stored cloud ID and add a regression test for a renamed local directory. Passing the new local directory name to the command, or explicitly pushing it first, is a workaround.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions