Fill LfsObjectsProject#repository_type for project and wiki repositories
LFS objects are deduplicated among all projects, and we have an LfsObjectsProject
join model to link a project to an LFS object. However, a project may have several repositories - project (code), wiki, design - and each of them may use LFS. So LfsObjectsProject
has a repository_type
field to specify which repository it's referencing.
This is currently filled for the design
repository, but not for the project
or wiki
repository, which complicates things like LFS push mirroring, or cleaning up unused LFS objects more generally.
We should ensure that we set repository_type
everywhere that we create an LfsObjectsProject
, and write a backfill migration that will populate repository_type
for existing LfsObjectsProject
rows - creating a new one if, say, an LFS object appears in both the project and wiki repository at the same time. We have a get_all_lfs_pointers
Gitaly RPC that should help with that.
Availability and Testing
Regression testing ensure LFS-related tests are passing, please ensure associated MR is labelled with pipeline:run-all-e2e and e2e:package-and-test
job is passing.