feat: Add immediate deletion of groups #168
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of your changes
On GitLab Premium and Ultimate, the delete action on a group just marks the group as deleted. By default, the group will be deleted seven days in the future. To delete the group immediately two rest calls are needed:
/groups/:id
which marks the group in the "pending for deletion" state (docs)/groups/:id
with attributespermanently_remove=true
andfull_path
set. The group will be deleted immediate.This change introduce the optional fields
PermanentlyRemove
andFullPath
on the GitLab group resource. This allows the user to enforce an immediate deletion of GitLab groups.The same behavior exist by deleting projects (see #121, #149) and could be implemented in the same way as done here for groups. Before this feature can be implemented for projects, one needs to extend the xanzy/go-gitlab client with
DeleteProjectOptions
along the lines of DeleteGroupOptions.I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested
Provider has been built locally and deployed on a AKS cluster. Deletion of GitLab Groups has been successfully end to end tested with and without PermanentlyRemove and FullPath fields set.