Skip to content
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

Add path_with_namespace to gitlab_project #403

Merged
merged 3 commits into from
Sep 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions gitlab/data_source_gitlab_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions gitlab/resource_gitlab_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions website/docs/d/project.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/project.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -89,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.

Expand Down