Skip to content

Commit 19016f8

Browse files
authored
Add path_with_namespace to gitlab_project (#403)
* Add path_with_namespace to gitlab_project * Add path_with_namespace to project resource docs * Move path_with_namespace Attributes Reference
1 parent 2a073e0 commit 19016f8

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

gitlab/data_source_gitlab_project.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ func dataSourceGitlabProject() *schema.Resource {
2727
Optional: true,
2828
Computed: true,
2929
},
30+
"path_with_namespace": {
31+
Type: schema.TypeString,
32+
Computed: true,
33+
},
3034
"description": {
3135
Type: schema.TypeString,
3236
Optional: true,
@@ -131,6 +135,7 @@ func dataSourceGitlabProjectRead(d *schema.ResourceData, meta interface{}) error
131135
d.SetId(fmt.Sprintf("%d", found.ID))
132136
d.Set("name", found.Name)
133137
d.Set("path", found.Path)
138+
d.Set("path_with_namespace", found.PathWithNamespace)
134139
d.Set("description", found.Description)
135140
d.Set("default_branch", found.DefaultBranch)
136141
d.Set("request_access_enabled", found.RequestAccessEnabled)

gitlab/resource_gitlab_project.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ var resourceGitLabProjectSchema = map[string]*schema.Schema{
2626
return old == new
2727
},
2828
},
29+
"path_with_namespace": {
30+
Type: schema.TypeString,
31+
Computed: true,
32+
},
2933
"namespace_id": {
3034
Type: schema.TypeInt,
3135
Optional: true,
@@ -217,6 +221,7 @@ func resourceGitlabProjectSetToState(d *schema.ResourceData, project *gitlab.Pro
217221
d.SetId(fmt.Sprintf("%d", project.ID))
218222
d.Set("name", project.Name)
219223
d.Set("path", project.Path)
224+
d.Set("path_with_namespace", project.PathWithNamespace)
220225
d.Set("description", project.Description)
221226
d.Set("default_branch", project.DefaultBranch)
222227
d.Set("request_access_enabled", project.RequestAccessEnabled)

website/docs/d/project.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ The following attributes are exported:
3030

3131
* `path` - The path of the repository.
3232

33+
* `path_with_namespace` - The path of the repository with namespace.
34+
3335
* `namespace_id` - The namespace (group or user) of the project. Defaults to your user.
3436
See [`gitlab_group`](../r/group.html) for an example.
3537

website/docs/r/project.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ The following additional attributes are exported:
8989

9090
* `id` - Integer that uniquely identifies the project within the gitlab install.
9191

92+
* `path_with_namespace` - The path of the repository with namespace.
93+
9294
* `ssh_url_to_repo` - URL that can be provided to `git clone` to clone the
9395
repository via SSH.
9496

0 commit comments

Comments
 (0)