Wait for group service account users to be deleted during destroy
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
This change adds a waiting mechanism to the GitLab group service account deletion process. After requesting deletion of a service account, the code now waits up to 10 minutes to confirm the deletion actually completed, checking every 10 seconds by trying to fetch the deleted account. If the account is truly gone (returns a 404 error), the deletion is considered successful. If the 10-minute timeout is reached without confirmation, it reports an error. This ensures that Terraform doesn't proceed with other operations until the service account is fully removed from GitLab's system, preventing potential conflicts or inconsistent states.
Fixes #6575 (closed)
Edited by Heidi Berry