Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wonder-sk opened this issue Oct 10, 2023 · 0 comments · Fixed by #187
Closed

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

wonder-sk opened this issue Oct 10, 2023 · 0 comments · Fixed by #187
Assignees
Labels
enhancement New feature or request refactor Internal code refactoring

Comments

@wonder-sk
Copy link
Contributor

wonder-sk commented Oct 10, 2023

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)

@wonder-sk wonder-sk added enhancement New feature or request refactor Internal code refactoring labels Oct 10, 2023
@wonder-sk wonder-sk changed the title Fix awkward create_project() syntax Fix awkward create_project() and clone_project() syntax Oct 11, 2023
@JanCaha JanCaha mentioned this issue Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor Internal code refactoring
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants