Skip to content

Fix awkward create_project() and clone_project() syntax #180

Closed
@wonder-sk

Description

@wonder-sk

create_project() syntax to create project "my_workspace/my_project" currently looks like this:

mc.create_project("my_project", namespace="my_workspace")

... which is awkward given that all(?) the other API calls dealing with projects use the full project name syntax with a slash. Let's make create_project() support the usual syntax:

mc.create_project("my_workspace/my_project")

It would be good to keep the old style still working so that we do not break backwards compatibility, but we could issue a deprecation warning.

There's also create_project_and_push() with the same problem.

And clone_project has this issue too:

mc.clone_project("my_workspace/project_src", "project_dst", namespace="my_workspace")

For cloning, also the CLI has this awkward syntax:

Usage: mergin clone [OPTIONS] SOURCE_PROJECT_PATH CLONED_PROJECT_NAME
                    [CLONED_PROJECT_NAMESPACE]

(should be mergin clone SOURCE_PROJECT_PATH CLONED_PROJECT_PATH)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestrefactorInternal code refactoring

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions