Recreate team resource on change to list of members. This allows a user to be deleted along with team membership(s). #35

Closed
tobiasbp wants to merge 2 commits from tobiasbp/terraform-provider-gitea:recreate-team-on-membership-change into main
Contributor

This PR recreates a team resource whenever the list of team members change.

This change is needed, as the deletion of a user who has a team membership will fail otherwise. This is because the user can not be deleted because it is a member of a team. The issue is described here: #30

Longer term, I think we should have a gitea_team_membership resource representing a user's membership of a team. That should make us able to not recreate the team on membership change.

I believe the recreating the team as proposed in this PR is not the best solution as:

  • Other members of the team will not have team rights until the team is recreated (flaky permissions issue as experiences by the Gitea users).
  • A situation where a team is not recreated (it's missing) because there was an error when creating a new user that should be a member of the team is possible (higher probability of broken state).
This PR recreates a team resource whenever the list of team members change. This change is needed, as the deletion of a user who has a team membership will fail otherwise. This is because the user can not be deleted because it is a member of a team. The issue is described here: https://gitea.com/gitea/terraform-provider-gitea/issues/30 Longer term, I think we should have a _gitea_team_membership_ resource representing a user's membership of a team. That should make us able to not recreate the team on membership change. I believe the recreating the team as proposed in this PR is not the best solution as: * Other members of the team will not have team rights until the team is recreated (flaky permissions issue as experiences by the Gitea users). * A situation where a team is not recreated (it's missing) because there was an error when creating a new user that should be a member of the team is possible (higher probability of broken state).
tobiasbp added 1 commit 2023-10-26 10:16:13 +00:00
Recreate team resource on change to list of members. This allows a user to be deleted along with team membership(s).
All checks were successful
Setup Terraform / Terraform Versions (pull_request) Successful in 8s
48e237f378
tobiasbp added 1 commit 2023-10-26 10:27:02 +00:00
Merge branch 'main' into recreate-team-on-membership-change
All checks were successful
Setup Terraform / Terraform Versions (pull_request) Successful in 6s
c6346286a1
Author
Contributor

This PR will no longer be relevant if the following PR is accepted: #36

This PR will no longer be relevant if the following PR is accepted: https://gitea.com/gitea/terraform-provider-gitea/pulls/36
tobiasbp requested review from techknowlogick 2023-10-31 15:00:30 +00:00

Thanks for all the PRs. Closing as 36 has been merged :)

Thanks for all the PRs. Closing as 36 has been merged :)
techknowlogick closed this pull request 2023-11-16 00:53:42 +00:00
All checks were successful
Setup Terraform / Terraform Versions (pull_request) Successful in 6s
Required
Details

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/terraform-provider-gitea#35
No description provided.