Remove design git repos when deleting a project
What does this MR do and why?
Related issue: #361356 (closed)
Remove design git repos when deleting a project
Avoid orphaning design git repos when projects are deleted
Screenshots or screen recordings
How to set up and validate locally
- Setup a project with a design repo, ensure the git repo exists
p = Project.first
p.design_repository
p.design_management_repository.create_if_not_exists
raw_repo = p.design_repository.raw_repository
raw_repo.exists? # should be true
- Destroy the project:
Projects::DestroyService.new(p, User.first).execute # assuming User.first has remove_project permission
- Check if the repo still exists:
raw_repo.exists? # should be false
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Aakriti Gupta