Skip to content

Draft: Export projects before deletion

George Koltsov requested to merge georgekoltsov/export-project-on-delete into master

What does this MR do and why?

This MR exports a project before deletion and uploads it to deleted_project_group_exports bucket in Object Storage, if configured.

  • If export happens for longer than 2 hours - timeout kicks in and project gets destroyed
  • Export won't start if object storage bucket is not configured or feature flag is not enabled

Note: delayed deletion enqueues the same worker as immediate deletion - ProjectDestroyWorker, so only this worker update is required.

TODO:

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

image

How to set up and validate locally

  1. Feature.enable(:export_project_before_deletion)
  2. Make sure your gdk has object storage configured and enabled https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/object_storage.md
  3. Update config/gitlab.yml in your local gdk and add a new bucket configuration:
  deleted_project_group_exports:
    object_store:
      enabled: true
      remote_directory: deleted-project-group-exports
      direct_upload: true
      connection:
        provider: AWS
        aws_access_key_id: minio
        aws_secret_access_key: gdk-minio
        region: gdk
        endpoint: 'http://127.0.0.1:9000'
        path_style: true
  1. Create a new project and delete it
  2. Go to minio browser and observe that the project got exported to deleted_project_group_exports
  3. Verify the project got deleted
Edited by George Koltsov

Merge request reports