Update snippet fixtures to include repositories
When we install from scratch GDK to start working on GitLab, we populate the database with some test data in order to have some working examples of different resources. One of the resources we create are PersonalSnippets
.
At the moment, when we create those snippet test records, we aren't creating the associated repositories, leaving these records in an invalid state.
The problem with the GDK installation is that the associated components, Workhorse, Gitaly, the web server, ..., aren't running. Therefore, we cannot "commit" the snippet content and follow the existing workflow.
My proposal would be to:
- Create a test snippet repository like the one we use in other fixtures
- Once we create each snippet, we check its
.disk_path
inside therepositories
folder, and clone a bare version of the former repository there. - We need to check first what the deal with shards would be. Are we cloning the only on the
default
shard? - Update the associated db records, like
SnippetRepository
. Maybe callingsnippet.track_snippet_repository
can be enough - Update the snippet statistics