-
Notifications
You must be signed in to change notification settings - Fork 948
github_repository_collaborator unable to validate triage and maintain permissions #480
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
Status: Needs infoFull requirements are not yet known, so implementation should not be startedFull requirements are not yet known, so implementation should not be startedStatus: StaleUsed by stalebot to clean houseUsed by stalebot to clean houseType: BugSomething isn't working as documentedSomething isn't working as documentedr/repository_collaborator
Milestone
Description
Terraform Version
v0.12.24
Provider Version
v2.8.0
Affected Resource(s)
- github_repository_collaborator
Terraform Configuration Files
data "github_membership" "test-user" {
username = "testuser"
}
resource "github_repository" "my-repo" {
name = "my-repo"
private = true
description = ""
}
resource "github_repository_collaborator" "my-repo-test-user" {
repository = github_repository.my-repo.name
username = data.github_membership.test-user.username
permission = "maintain"
}terraform import github_repository_collaborator.my-repo-test-user my-repo:testuserExpected Behavior
After importing an existing collaborator with Maintain permissions the collaborator should have maintain permissions in the state.
Actual Behavior
After importing an existing collaborator with Maintain permissions the collaborator gets push permissions in the state. Running terraform plan afterwards notes a replacement.
# github_repository_collaborator.my-repo-test-user must be replaced
-/+ resource "github_repository_collaborator" "my-repo-test-user" {
~ id = "my-repo:testuser" -> (known after apply)
+ invitation_id = (known after apply)
~ permission = "push" -> "maintain" # forces replacement
repository = "my-repo"
username = "testuser"
}
Running terraform apply in the end leads to
Error: User testuser is already a collaborator
Overall, the error is similar to #469, but the actual problem seems to be the import to the state in this situation.
Steps to Reproduce
terraform import github_repository_collaborator.my-repo-test-user my-repo:testuserterraform planterraform apply
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Status: Needs infoFull requirements are not yet known, so implementation should not be startedFull requirements are not yet known, so implementation should not be startedStatus: StaleUsed by stalebot to clean houseUsed by stalebot to clean houseType: BugSomething isn't working as documentedSomething isn't working as documentedr/repository_collaborator