-
Notifications
You must be signed in to change notification settings - Fork 949
GitHub Enterprise provider compatibility #404
Description
With the recent provider update to 2.5.0 we experienced an issue with our organization management using this provider.
hashicorp/terraform-provider-github@v2.4.1...v2.5.0
Included in this, which seems more likely, was an update in google/go-github :
google/go-github@v29.0.2...v29.0.3
With the upgrade in go-github it looks like the APIs surrounding teams got chagned. In at least one case, I see a deprecation message in the documentation. The result is that all github_team resources are thought to not exist, so it wants to re-create them (unsure if creation would even succeed at this point). Additionally github_team_repository resources, which rely on the github_team relationship are also affected and these APIs have changed as well.
While I imagine that this isn't so much as a bug as it is a compatibility issue, I think that GitHub Enterprise users need messaging regarding compatibility with this provider. As it stands, it looks like GitHub Enterprise v2.20.3 is compatible only up to v2.4.1 of this provider.
Terraform Version
0.12.24
Affected Resource(s)
- github_team
- github_team_repository
Note: When using GitHub Enterprise (tested with v2.20.3)
Terraform Configuration Files
https://www.terraform.io/docs/providers/github/r/team_repository.html
# Add a repository to the team
resource "github_team" "some_team" {
name = "SomeTeam"
description = "Some cool team"
}
resource "github_repository" "some_repo" {
name = "some-repo"
}
resource "github_team_repository" "some_team_repo" {
team_id = "${github_team.some_team.id}"
repository = "${github_repository.some_repo.name}"
permission = "pull"
}Debug Output
https://gist.github.com/mengesb/811cadacde485dba7d36807ff9ae42b5
Panic Output
N/A
Expected Behavior
Teams and team repositories shouldn't change after provider update, or there should be some documentation about provider compatibility in the case of GitHub Enterprise vs GitHub
Actual Behavior
When a plan is ran with provider 2.4.x, and generates resources, an update to provider version 2.5.x results in it re-generating the same team and team_repository resources. If there are members of the team - those trigger regeneration due to vertex changes
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform applywith v2.4.1- Update provider to 2.5.0
terraform apply
Important Factoids
Github Enterprise v2.20.3
https://developer.github.com/enterprise/2.20/v3/teams/#get-team
vs
https://developer.github.com/v3/teams/#get-team-by-name
https://developer.github.com/v3/teams/#get-team-legacy (deprecated - compat w/2.20.3)
https://developer.github.com/enterprise/2.20/v3/teams/#check-if-a-team-manages-a-repository
vs
https://developer.github.com/v3/teams/#list-team-repos