Draft: Export projects before deletion
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:
-
Make sure new bucket exists -
Update omnibus config, if required https://gitlab.com/gitlab-org/omnibus-gitlab/ -
Update GDK config, if required https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/support/templates/gitlab/config/gitlab.yml.erb
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
How to set up and validate locally
Feature.enable(:export_project_before_deletion)
- 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
- 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
- Create a new project and delete it
- Go to minio browser and observe that the project got exported to
deleted_project_group_exports
- Verify the project got deleted
Edited by George Koltsov