From 447b6d1407057494357b6d303cfbc53e523494ac Mon Sep 17 00:00:00 2001 From: peric Date: Thu, 10 Sep 2020 10:06:51 +0200 Subject: [PATCH 1/3] Add path_with_namespace to gitlab_project --- gitlab/data_source_gitlab_project.go | 5 +++++ gitlab/resource_gitlab_project.go | 5 +++++ website/docs/d/project.html.markdown | 2 ++ 3 files changed, 12 insertions(+) diff --git a/gitlab/data_source_gitlab_project.go b/gitlab/data_source_gitlab_project.go index d474f662d..3213a6d32 100644 --- a/gitlab/data_source_gitlab_project.go +++ b/gitlab/data_source_gitlab_project.go @@ -27,6 +27,10 @@ func dataSourceGitlabProject() *schema.Resource { Optional: true, Computed: true, }, + "path_with_namespace": { + Type: schema.TypeString, + Computed: true, + }, "description": { Type: schema.TypeString, Optional: true, @@ -131,6 +135,7 @@ func dataSourceGitlabProjectRead(d *schema.ResourceData, meta interface{}) error d.SetId(fmt.Sprintf("%d", found.ID)) d.Set("name", found.Name) d.Set("path", found.Path) + d.Set("path_with_namespace", found.PathWithNamespace) d.Set("description", found.Description) d.Set("default_branch", found.DefaultBranch) d.Set("request_access_enabled", found.RequestAccessEnabled) diff --git a/gitlab/resource_gitlab_project.go b/gitlab/resource_gitlab_project.go index fc831a072..d0158135e 100644 --- a/gitlab/resource_gitlab_project.go +++ b/gitlab/resource_gitlab_project.go @@ -26,6 +26,10 @@ var resourceGitLabProjectSchema = map[string]*schema.Schema{ return old == new }, }, + "path_with_namespace": { + Type: schema.TypeString, + Computed: true, + }, "namespace_id": { Type: schema.TypeInt, Optional: true, @@ -217,6 +221,7 @@ func resourceGitlabProjectSetToState(d *schema.ResourceData, project *gitlab.Pro d.SetId(fmt.Sprintf("%d", project.ID)) d.Set("name", project.Name) d.Set("path", project.Path) + d.Set("path_with_namespace", project.PathWithNamespace) d.Set("description", project.Description) d.Set("default_branch", project.DefaultBranch) d.Set("request_access_enabled", project.RequestAccessEnabled) diff --git a/website/docs/d/project.html.markdown b/website/docs/d/project.html.markdown index 4646ee076..3ac22fe6f 100644 --- a/website/docs/d/project.html.markdown +++ b/website/docs/d/project.html.markdown @@ -30,6 +30,8 @@ The following attributes are exported: * `path` - The path of the repository. +* `path_with_namespace` - The path of the repository with namespace. + * `namespace_id` - The namespace (group or user) of the project. Defaults to your user. See [`gitlab_group`](../r/group.html) for an example. From 250f23dbe4abc35f27ce301840ce288a506bf7b8 Mon Sep 17 00:00:00 2001 From: peric Date: Fri, 11 Sep 2020 10:13:53 +0200 Subject: [PATCH 2/3] Add path_with_namespace to project resource docs --- website/docs/r/project.html.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/docs/r/project.html.markdown b/website/docs/r/project.html.markdown index 8f7a703af..08e3950b4 100644 --- a/website/docs/r/project.html.markdown +++ b/website/docs/r/project.html.markdown @@ -31,6 +31,8 @@ The following arguments are supported: * `path` - (Optional) The path of the repository. +* `path_with_namespace` - The path of the repository with namespace. + * `namespace_id` - (Optional) The namespace (group or user) of the project. Defaults to your user. See [`gitlab_group`](group.html) for an example. From 357ca7673f90e96858560343c46f723941dd893b Mon Sep 17 00:00:00 2001 From: peric Date: Fri, 11 Sep 2020 21:07:09 +0200 Subject: [PATCH 3/3] Move path_with_namespace Attributes Reference --- website/docs/r/project.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/r/project.html.markdown b/website/docs/r/project.html.markdown index 08e3950b4..b9a0be014 100644 --- a/website/docs/r/project.html.markdown +++ b/website/docs/r/project.html.markdown @@ -31,8 +31,6 @@ The following arguments are supported: * `path` - (Optional) The path of the repository. -* `path_with_namespace` - The path of the repository with namespace. - * `namespace_id` - (Optional) The namespace (group or user) of the project. Defaults to your user. See [`gitlab_group`](group.html) for an example. @@ -91,6 +89,8 @@ The following additional attributes are exported: * `id` - Integer that uniquely identifies the project within the gitlab install. +* `path_with_namespace` - The path of the repository with namespace. + * `ssh_url_to_repo` - URL that can be provided to `git clone` to clone the repository via SSH.