-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Gitlab EE soft-delete of groups and projects #291
Conversation
@weimeng and @kuahyeow, I have further analysed the logs from an acceptance test run with DEBUG output showing the requests and respones going to and coming from a Gitlab server. I detected an inconsistency between
Note the difference in the last two characters of the field name. Additional question: is there even a |
gitlab/resource_gitlab_group.go
Outdated
@@ -208,6 +208,10 @@ func resourceGitlabGroupDelete(d *schema.ResourceData, meta interface{}) error { | |||
log.Printf("[ERROR] Received error: %#v", err) | |||
return out, "Error", err | |||
} | |||
if out.PendingDelete { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure GitLab has pending_delete
for groups, but rather it has marked_for_deletion_on
instead.
Here's a snippet of JSON for https://gitlab.com/api/v4/groups/9970
{"id":9970,"web_url":"https://gitlab.com/groups/gitlab-org","name":"GitLab.org","path":"gitlab-org","description":"Open source software to collaborate on code","visibility":"public","share_with_group_lock":false,"require_two_factor_authentication":true,"two_factor_grace_period":120,"project_creation_level":"developer","auto_devops_enabled":null,"subgroup_creation_level":"owner","emails_disabled":false,"mentions_disabled":true,"lfs_enabled":true,"default_branch_protection":2,"avatar_url":"https://assets.gitlab-static.net/uploads/-/system/group/avatar/9970/logo-extra-whitespace.png","request_access_enabled":false,"full_name":"GitLab.org","full_path":"gitlab-org","created_at":"2013-09-26T06:02:04.000Z","parent_id":null,"ldap_cn":null,"ldap_access":null,"file_template_project_id":null,"marked_for_deletion_on":null,
Yeah, I have noticed this and opened https://gitlab.com/gitlab-org/gitlab/-/issues/212937
I don't think there's a |
Support for Gitlab EE soft-delete of groups and projects
Adding the support in the
gitlab_group
andgitlab_project
resources for soft delete as defined in Gitlab Enterprise Edition since version 12.Fixes: #263
@weimeng and/or @kuahyeow I still could use some help with the Gitlab Enterprise Edition test suite. On Github Actions, I can't get them to run. First of all, they time out which means that the tests are hanging somewhere. I also have several failures.
Comparing this to the Gitlab CE test suite. These are the same tests, but they all succeed when running against the Gitlab CE edition. Also, when I run the test suite against Gitlab EE on my local mac in a Vagrant box, they run in about 11 minutes and I have 1 test failure which I think is related to #269.
Would one of you be open for a conference call where we could discuss things? With me knowing how TF tests work and you knowing how Gitlab and the API work, we have to bring this knowledge together to get this working.