[BUG]: detailed_repositories in github_team data_source truncates to last page
Expected Behavior
When referencing the detailed_repositories attribute from a github_team data source, all team repositories are expected.
Actual Behavior
The list of repositories is truncated based on the results_per_page. I think it is caused by the following line: https://github.com/integrations/terraform-provider-github/blob/5752b2581349fcf4dc7be0c093445591abdfbe91/github/data_source_github_team.go#L177C5-L177C5
data.github_team.team: Reading...
data.github_team.team: Still reading... [10s elapsed]
data.github_team.team: Read complete after 17s [id=<teamid>]
Changes to Outputs:
+ team_repos = [
+ "example1",
+ "example2",
+ "example3",
+ "example4",
+ "example5",
]
+ team_repos_detailed = [
+ {
+ repo_id = <example4>
+ role_name = "read"
},
+ {
+ repo_id = <example5>
+ role_name = "read"
}
]
You can apply this plan to save these new output values to the Terraform state, without changing any real infrastructure.
Terraform Version
Terraform v1.6.6 on windows_amd64
- provider registry.terraform.io/integrations/github v5.44.0
Affected Resource(s)
- github_team
Terraform Configuration Files
data "github_team" "team" {
slug = "example"
results_per_page = 3
}
output "team_repos_detailed" {
value = data.github_team.team.repositories_detailed
}
output "team_repos" {
value = data.github_team.team.repositories
}
Steps to Reproduce
terraform plan
Debug Output
No response
Panic Output
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
It would also be nice if detailed_repositories included the repo name as referenced here: https://github.com/integrations/terraform-provider-github/issues/1670#issuecomment-1537157377
Hey @bmv0161 thanks for tracking this down. Let us know if you'd be interested in fixing the issue and submitting a PR. For now I have labeled this as "Up For Grabs" so that the community can take a stab at getting this fixed as well. ❤️
Any updates on this issue? Happy to help if help is still needed!
@n47h4n12 please feel free to submit a PR if you'd like!
@kfcampbell PR #2248 has been submitted. Can you please review?