Step 1: Update snippet services to the current format (MVP)
Service snippets are quite old and haven't been refactored for a while. We should:
- Move the services to their own snippet namespace (aka
Snippets::CreateService
). - They should inherit from
app/services/base_service.rb
and return the proper objects. - We should create the missing service for deleting snippets. At the moment, when we delete a snippet we directly call
snippet.destroy
. We should perform this action through a service object instead, likeSnippets::DestroyService
.- We should update the following locations where we perform that action:
app/controllers/projects/snippets_controller.rb
app/controllers/snippets_controller.rb
app/graphql/mutations/snippets/destroy.rb
- We should update the following locations where we perform that action:
Once we update these services, we will have to update also those places where we use them like in the controllers, api and graphql endpoints.
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.
Edited by 🤖 GitLab Bot 🤖