Step 2: Version Control for Snippets: Delete snippet repositories (MVP)
Important: All the new functionality must be implemented behind the feature flag :version_snippets
. Besides, it has to be scoped for projects. Therefore, instead of checking if the feature flag is enabled or not (Feature.enabled?(:version_snippets)
), we will check if the feature flag is enabled for specific projects (Feature.enabled?(:version_snippets, project)
). This way, for testing purposes, we can enable the feature flag on the project gitlab-org/gitlab
for example, instead of enabling it globally.
In this issue, we will add the functionality to delete the snippet repositories. This can happen when:
- the project is deleted
- the snippet is deleted
In order to delete the snippet repositories when the project is deleted, we will need to add them to the Projects::DestroyService#trash_repositories!
. The destroy happens in 2 steps:
- a move of the repository to a temporary place
"#{path}+#{project.id}#{DELETED_FLAG}"
- Async, the temporary directory is removed.
We could refactor the project's destroy service and avoid adding every kind of new repository we add. Comment in #13429 (comment 202162773).
When the snippet is deleted through the snippet's delete service, that we will implement in #39083 (closed), we will have to add the logic to remove the repository. It should work in a similar way that it does in the project deletion workflow. We cannot delete the repositories directly.
This issue depends on #39176 (closed) and #39083 (closed) to be implemented first.
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.