From 3700bea38ac95fb72d23bc944b9f8a6558e765d8 Mon Sep 17 00:00:00 2001
From: Diane Russel <drussel@gitlab.com>
Date: Mon, 10 Mar 2025 17:55:50 -0400
Subject: [PATCH] Update data deletion guidelines

---
 doc/development/deleting_data.md | 50 +++++++++-----------------------
 1 file changed, 13 insertions(+), 37 deletions(-)

diff --git a/doc/development/deleting_data.md b/doc/development/deleting_data.md
index a595d7f28fd15..672689c2955d0 100644
--- a/doc/development/deleting_data.md
+++ b/doc/development/deleting_data.md
@@ -12,54 +12,30 @@ Generally, there are two ways to delete data:
 - Mark for deletion: Identifies data for removal at a future date. This is the preferred approach.
 - Hard deletion: Immediately and permanently removes data.
 
-## Mark for deletion
+## Avoid direct hard deletion
 
-You should avoid direct calls to hard delete classes, as this can lead to unintended data loss.
+Direct calls to hard delete classes should be avoided because it can lead to unintended data loss.
+Specifically, avoid invoking the following classes:
 
-{{< tabs >}}
+- `Projects::DestroyService`
+- `ProjectDestroyWorker`
+- `Groups::DestroyService`
+- `GroupDestroyWorker`
 
-{{< tab title="Projects" >}}
+## Recommended approach
 
-```ruby
-Projects::MarkForDeletionService.new(project, current_user).execute
-```
+### For projects
 
-{{< /tab >}}
-
-{{< tab title="Groups" >}}
+Instead of using `Projects::DestroyService`, use `Projects::MarkForDeletionService`. 
 
 ```ruby
-Groups::MarkForDeletionService.new(group, current_user).execute
-```
-
-{{< /tab >}}
-
-{{< /tabs >}}
-
-## Hard deletion
-
-If you must delete data, use the following classes to hard delete from the codebase.
-
-{{< tabs >}}
-
-{{< tab title="Projects" >}}
-
-```ruby
-Projects::DestroyService.new(project, user, {}).execute
-
-ProjectDestroyWorker.perform_async(project_id, user_id, params)
+Projects::MarkForDeletionService.new(project, current_user).execute
 ```
 
-{{< /tab >}}
+### For groups
 
-{{< tab title="Groups" >}}
+Instead of using `Groups::DestroyService`, use `Groups::MarkForDeletionService`. 
 
 ```ruby
 Groups::MarkForDeletionService.new(group, current_user).execute
-
-GroupDestroyWorker.new.perform(group_id, user_id)
 ```
-
-{{< /tab >}}
-
-{{< /tabs >}}
-- 
GitLab