Skip to content

GitLab Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • See what's new at GitLab
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
GitLab
GitLab
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 34,392
    • Issues 34,392
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 1,155
    • Merge Requests 1,155
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Metrics
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GitLab.org
  • GitLabGitLab
  • Issues
  • #32935

Closed
Open
Opened Sep 27, 2019 by Jeremy Watson@jeremy🤠Maintainer

Preventing accidental project deletion via soft delete

Problem

One of the worst scenarios for an administrator is losing data without a path to recovery. We especially hear this with enterprises, who have large userbases (differing levels of familiarity with GitLab may lead to accidents).

To prevent this from happening with projects, we shipped #5615 (closed) - but this first iteration only helps self-managed instances. Ideally, we should have a flexible way of either preventing projects from being deleted without a recovery option or carving out a quick way to restore a deleted project that extends to GitLab.com.

Proposal

Require a soft deletion period for project removal.

  • Attempting to remove a project marks it for deletion (and archives it, in the case of projects). It should no longer immediately remove the project.
  • After X days have elapsed, the project or group is deleted.
    • An instance should be able to set this to 0 to essentially enable immediate removal, but this should not be default behavior. Default behavior should be something like 7 days.
  • Attempting to delete something:
    • The "remove project" container for projects should reflect the soft deletion period.
    • A project pending deletion should be archived and marked for deletion. I should be able to tell that a project is marked for deletion in the UI and via an attribute associated with the project (obtainable via the Projects API).
    • Attempting to delete a project with the API should also result in the soft deletion period as described above.
  • Recovering a project or group pending deletion:
    • Include a "restore" button in project/group settings that unarchives the project and removes the soft deletion state.
    • Should be able to restore/remove the soft deletion state via API.
  • Soft deletion and restore should trigger an audit event.

Mockups

Marking a project for deletion

  • Change the "remove project" container to note the new approach:

image

  • We'll need to also change text in the confirmation modal.

Displaying a project pending delete

  • As a short-term path forward, we're recommending that we use our "archived project" design approach. We can note a project as pending deletion on the overview page:

image

  • We should also update the archived badge we use in project lists to denote that a project is pending removal on the profile page:

image

Unmarking a project for deletion

  • Add a "restore project" container to project settings:

image

Follow ups

See #33257 (closed) for extending soft delete to groups.

Additional detail

  • Existing behavior of archived projects gets us mostly there in terms of read-only behavior of a project.
  • For name conflicts (attempting to create a project with the same name as a project marked for deletion): it's fine to throw an error - the workaround would be renaming one of the projects. Could be a bit annoying, but something we can iterate on if we get feedback that these collisions happen often.
Edited Nov 10, 2019 by Jeremy Watson
Assignee
Assign to
12.6
Milestone
12.6 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: gitlab-org/gitlab#32935