Step 3: Version Control for Snippets: Update snippet repository content through the UI (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.
This issue is about adding content (create commits) in the snippet repository. We will be able to do this through:
- The UI when the user creates a snippet with content or when the user updates the content or add new files.
- When the user pushes to the snippet repository.
When the user uses the UI, we will have to user the method repository.multi_action
with the proper git
action, the content, and the commit message.
Based on the repository routes, we have to finally decide if the assert and the decision made in #39176 (closed) was right or not:
The new snippet repositories will be stored inside the same hashed directory as the project, wiki, and design management repository. Nevertheless, we need to scope them somehow because compare to the other types of repositories, we can have several snippet repositories in the same place as the other repositories.
Another important point is that the file names in snippets can be optional. This means that, when we save the file, we have to automatically give some sort of default name like snippetfile1.txt
or something similar.
This issue depends on #39176 (closed) and #39199 (closed) to be implemented first.
Availability and Testing
This should be covered by adjusting (if necessary) the existing E2E create_snippet_spec.rb
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.