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
Modify databricks_repo to support Git folders in the workspace (#3447)
* Modify `databricks_repo` to support Git folders in the workspace
Changes include:
* adjust `path` check to enforce it only on `/Repos`, not everywhere.
* adjust documentation
* address comments
---------
Co-authored-by: Miles Yucht <[email protected]>
Copy file name to clipboardExpand all lines: docs/resources/repo.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,13 @@ subcategory: "Workspace"
3
3
---
4
4
# databricks_repo Resource
5
5
6
-
This resource allows you to manage [Databricks Repos](https://docs.databricks.com/repos.html).
6
+
This resource allows you to manage [Databricks Git folders](https://docs.databricks.com/en/repos/index.html) (formerly known as Databricks Repos).
7
7
8
-
-> **Note** To create a Repo from a private repository you need to configure Git token as described in the [documentation](https://docs.databricks.com/repos.html#configure-your-git-integration-with-databricks). To set this token you can use [databricks_git_credential](git_credential.md) resource.
8
+
-> **Note** To create a Git folder from a private repository you need to configure Git token as described in the [documentation](https://docs.databricks.com/en/repos/index.html#configure-your-git-integration-with-databricks). To set this token you can use [databricks_git_credential](git_credential.md) resource.
9
9
10
10
## Example Usage
11
11
12
-
You can declare Terraform-managed Repo by specifying `url` attribute of Git repository. In addition to that you may need to specify `git_provider` attribute if Git provider doesn't belong to cloud Git providers (Github, GitLab, ...). If `path` attribute isn't provided, then repo will be created in the user's repo directory (`/Repos/<username>/...`):
12
+
You can declare Terraform-managed Git folder by specifying `url` attribute of Git repository. In addition to that you may need to specify `git_provider` attribute if Git provider doesn't belong to cloud Git providers (Github, GitLab, ...). If `path` attribute isn't provided, then Git folder will be created in the default location:
-> **Note**Repo in Databricks workspace would only be changed, if Terraform stage did change. This means that any manual changes to managed repository won't be overwritten by Terraform, if there's no local changes to configuration. If Repo in Databricks workspace is modifying, application of configuration changes will fail.
23
+
-> **Note**Git folder in Databricks workspace would only be changed, if Terraform stage did change. This means that any manual changes to managed repository won't be overwritten by Terraform, if there's no local changes to configuration. If Git folder in Databricks workspace is modified, application of configuration changes will fail.
24
24
25
25
The following arguments are supported:
26
26
27
-
*`url` - (Required) The URL of the Git Repository to clone from. If the value changes, repo is re-created.
27
+
*`url` - (Required) The URL of the Git Repository to clone from. If the value changes, Git folder is re-created.
28
28
*`git_provider` - (Optional, if it's possible to detect Git provider by host name) case insensitive name of the Git provider. Following values are supported right now (could be a subject for a change, consult [Repos API documentation](https://docs.databricks.com/dev-tools/api/latest/repos.html)): `gitHub`, `gitHubEnterprise`, `bitbucketCloud`, `bitbucketServer`, `azureDevOpsServices`, `gitLab`, `gitLabEnterpriseEdition`, `awsCodeCommit`.
29
-
*`path` - (Optional) path to put the checked out Repo. If not specified, then repo will be created in the user's repo directory (`/Repos/<username>/...`). If the value changes, repo is re-created.
29
+
*`path` - (Optional) path to put the checked out Git folder. If not specified, , then the Git folder will be created in the default location. If the value changes, Git folder is re-created.
30
30
*`branch` - (Optional) name of the branch for initial checkout. If not specified, the default branch of the repository will be used. Conflicts with `tag`. If `branch` is removed, and `tag` isn't specified, then the repository will stay at the previously checked out state.
31
31
*`tag` - (Optional) name of the tag for initial checkout. Conflicts with `branch`.
32
32
33
33
### sparse_checkout
34
34
35
-
Optional `sparse_checkout` configuration block contains attributes related to [sparse checkout feature](https://docs.databricks.com/repos/git-operations-with-repos.html#configure-sparse-checkout-mode) in Databricks Repos. It supports following attributes:
35
+
Optional `sparse_checkout` configuration block contains attributes related to [sparse checkout feature](https://docs.databricks.com/repos/git-operations-with-repos.html#configure-sparse-checkout-mode) in Databricks Git folders. It supports following attributes:
36
36
37
37
*`patterns` - array of paths (directories) that will be used for sparse checkout. List of patterns could be updated in-place.
38
38
39
-
Addition or removal of the `sparse_checkout` configuration block will lead to recreation of the repo.
39
+
Addition or removal of the `sparse_checkout` configuration block will lead to recreation of the Git folder.
40
40
41
41
42
42
## Attribute Reference
43
43
44
44
In addition to all arguments above, the following attributes are exported:
45
45
46
-
*`id` - Repo identifier
46
+
*`id` - Git folder identifier
47
47
*`commit_hash` - Hash of the HEAD commit at time of the last executed operation. It won't change if you manually perform pull operation via UI or API
48
48
*`workspace_path` - path on Workspace File System (WSFS) in form of `/Workspace` + `path`
49
49
@@ -53,7 +53,7 @@ In addition to all arguments above, the following attributes are exported:
53
53
54
54
## Import
55
55
56
-
The resource Repo can be imported using the Repo ID (obtained via UI or using API)
56
+
The resource can be imported using the Git folder ID (obtained via UI or using API)
0 commit comments