Add permanently_remove support to project delete#1110
Open
msrouchou wants to merge 4 commits into
Open
Conversation
Exposes the permanently_remove and full_path query parameters on IProjectClient.DeleteAsync, matching the GitLab API behavior where v18+ soft-deletes by default and requires an explicit flag to bypass the grace period. https://docs.gitlab.com/api/projects/#delete-a-project
bc5b29c to
065b10c
Compare
louis-z
requested changes
Jun 30, 2026
|
|
||
| [Test] | ||
| public async Task DeleteAsync_WhenProjectExists_ItIsDeleted() | ||
| public async Task DeleteAsync_WhenProjectExists_ItIsMarkedForDeletion() |
Member
There was a problem hiding this comment.
For better consistency with the additional test that follows this one:
Suggested change
| public async Task DeleteAsync_WhenProjectExists_ItIsMarkedForDeletion() | |
| public async Task DeleteAsync_WhenProjectExists_MarksProjectForDeletion() |
| // Assert | ||
| var markedProject = await projectClient.GetAsync(project.Id); | ||
| Assert.That(markedProject.MarkedForDeletionOn, Is.Not.Null); | ||
| Assert.That(markedProject.MarkedForDeletionOn!.Value.Date, Is.EqualTo(DateTime.UtcNow.Date)); |
Member
There was a problem hiding this comment.
How come deletion is scheduled for today? I'm assuming this is due to a server setting, but can you provide a comment that explains it?
| var project = await projectClient.GetAsync(projectFullPath); | ||
|
|
||
| // First call: soft-mark | ||
| await projectClient.DeleteAsync(project.Id); |
Member
There was a problem hiding this comment.
Is this call really needed, especially since we don't assert anything after it? Besides, the soft delete path is already tested elsewhere.
| var project = await projectClient.GetAsync(projectFullPath); | ||
|
|
||
| // Soft-mark first | ||
| await projectClient.DeleteAsync(project.Id); |
Comment on lines
+56
to
+57
| var @operator = url.Contains('?') ? "&" : "?"; | ||
| url += $"{@operator}full_path={options.FullPath}"; |
Member
There was a problem hiding this comment.
Suggested change
| var @operator = url.Contains('?') ? "&" : "?"; | |
| url += $"{@operator}full_path={options.FullPath}"; | |
| url = Utils.AddParameter(url, "full_path", options.FullPath); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Exposes the
permanently_removeandfull_pathquery parameters onIProjectClient.DeleteAsync,matching the GitLab API behavior where v18+ soft-deletes by default and requires an explicit flag to bypass the grace period.https://docs.gitlab.com/api/projects/#delete-a-project