Skip to content

Commit

Permalink
Merge pull request #383 from patrickmarabeas/node-ids
Browse files Browse the repository at this point in the history
Compute node ids for repo, user and team resources & data sources
  • Loading branch information
Jeremy Udit authored Apr 3, 2020
2 parents 077e7ae + 3501145 commit a372e8a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions github/data_source_github_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ func dataSourceGithubRepository() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"node_id": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -153,6 +157,7 @@ func dataSourceGithubRepositoryRead(d *schema.ResourceData, meta interface{}) er
d.Set("git_clone_url", repo.GitURL)
d.Set("http_clone_url", repo.CloneURL)
d.Set("archived", repo.Archived)
d.Set("node_id", repo.GetNodeID())

err = d.Set("topics", flattenStringList(repo.Topics))
if err != nil {
Expand Down
5 changes: 5 additions & 0 deletions github/data_source_github_team.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ func dataSourceGithubTeam() *schema.Resource {
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
"node_id": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -72,6 +76,7 @@ func dataSourceGithubTeamRead(d *schema.ResourceData, meta interface{}) error {
d.Set("description", team.GetDescription())
d.Set("privacy", team.GetPrivacy())
d.Set("permission", team.GetPermission())
d.Set("node_id", team.GetNodeID())

return nil
}
Expand Down
5 changes: 5 additions & 0 deletions github/data_source_github_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ func dataSourceGithubUser() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"node_id": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -145,6 +149,7 @@ func dataSourceGithubUserRead(d *schema.ResourceData, meta interface{}) error {
d.Set("following", user.GetFollowing())
d.Set("created_at", user.GetCreatedAt())
d.Set("updated_at", user.GetUpdatedAt())
d.Set("node_id", user.GetNodeID())

return nil
}
5 changes: 5 additions & 0 deletions github/resource_github_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ func resourceGithubRepository() *schema.Resource {
},
},
},
"node_id": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -317,6 +321,7 @@ func resourceGithubRepositoryRead(d *schema.ResourceData, meta interface{}) erro
d.Set("http_clone_url", repo.CloneURL)
d.Set("archived", repo.Archived)
d.Set("topics", flattenStringList(repo.Topics))
d.Set("node_id", repo.GetNodeID())

if repo.TemplateRepository != nil {
d.Set("template", []interface{}{
Expand Down
5 changes: 5 additions & 0 deletions github/resource_github_team.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ func resourceGithubTeam() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"node_id": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -143,6 +147,7 @@ func resourceGithubTeamRead(d *schema.ResourceData, meta interface{}) error {
}
d.Set("ldap_dn", team.GetLDAPDN())
d.Set("slug", team.GetSlug())
d.Set("node_id", team.GetNodeID())

return nil
}
Expand Down

0 comments on commit a372e8a

Please sign in to comment.