Create model, table, and uploader for project-level package files
Background
Some package formats require the existance of files outside of the individual package. RPM yum/dnf repositories use a set of xml metadata files that live at the repository-level. For the GitLab package registry, this means the project-level.
Proposal
Similar to how we have Packages::PackageFiles
for package files associated to a given Package
, we need a new model to define package files that are associated with a project, or all packages of a certain type within that project.
- Create a new model
Packages::RepositoryPackageFiles
with a matching tableproject_repository_package_files
- Create a new uploader
Packages::RepositoryPackageFileUploader
. Thedynamic_segment
should beGitlab::HashedPath.new('projects', model.project.id, 'package_repository_files', model.id, root_hash: model.project_id)
Implementation notes
- We need to include these files in the project statistics using
update_project_statistics project_statistics_name: :packages_size
- These should be destroyed upon project deletion. We should be able to tie it in to the existing
Packages::Destructible
model so it is deleted async.