terraform-provider-gitlab icon indicating copy to clipboard operation
terraform-provider-gitlab copied to clipboard

Cannot delete project on gitlab ultimate

Open pjastrzabek opened this issue 1 year ago • 1 comments

GitLab Provider version

No response

GitLab version

No response

Terraform version

No response

Relevant Terraform Configuration

No response

Relevant log output

gitlab_project.xxx: Still destroying... [id=176532, 9m50s elapsed]
gitlab_project.xxx: Still destroying... [id=176532, 10m0s elapsed]

Description

Gitlab with Ultimate license introduces delayed project deletion

After deleting project it's not really deleted by default, but rather is scheduled for deletion which will be executed later (according to settings configured on project level or group level).

But it's possible to delete it via API immediately. Would be great if terraform provider supports that case otherwise project deletion just timeouts.

gitlab_project.xxx: Still destroying... [id=176532, 9m50s elapsed]
gitlab_project.xxx: Still destroying... [id=176532, 10m0s elapsed]

Support for me means:

  • either using some 'force_delete' flag
  • and / or option to specify that setting during project creation

pjastrzabek avatar Sep 15 '22 12:09 pjastrzabek

Multiple things here:

After deleting project it's not really deleted by default, but rather is scheduled for deletion which will be executed later (according to settings configured on project level or group level).

So it wouldn't work to change the group setting to delete it immediately?

image

Unfortunately, the GitLab upstream API doesn't yet support to configure that - however, it's inherited from the parent group, up to the instance level where the delayed group removal is actually configured ...

But it's possible to delete it via API immediately.

How?

either using some 'force_delete' flag

For groups there will be some new deletion flags in 15.4 which support the immediate removal of groups, but I don't see anything for projects.

A possible solution without upstream API changes could be to introduce an attribute in the gitlab_project resource to not wait until the project has been removed, but just fire and forget that request.

timofurrer avatar Sep 16 '22 08:09 timofurrer