dbx
dbx copied to clipboard
[FEATURE] Create Repo if it doesn't exist in the user directory
At initial launch of dbx sync repo verify that repo exists, if doesn't - create it.
Looking at the API below, it does not support creating an empty repo, which is probably what we'd want to do here:
https://docs.databricks.com/dev-tools/api/latest/repos.html#operation/create-repo
The API doesn't support creating empty repos but has a bug that can be leveraged - if you specify the url as an empty string then the repo is created despite getting an error message.
Example body:
{
"url": "",
"provider": "gitHub",
"path": "/Repos/dev/test_repo"
}
Example error response
{
"error_code": "INVALID_PARAMETER_VALUE",
"message": "Git repository URL missing for project"
}
It seems that the API first creates the repo folder, then attempts to connect to VCS to download the repo contents. If this fails there is no rollback process for the folder creation. This isn't a good basis for adding the feature requests, but hopefully this information might be helpful to someone in the future.