Skip to content

RPM packages process worker

Maksym Shabelnyk requested to merge 372737-rpm-process-package-worker into master

What does this MR do and why?

Added Packages::Rpm::Process worker which is called via RPM package upload or destruction. Depending on it worker passes package file to Packages::Rpm::InitializePackageService for Packages::Rpm::RepositoryFiles creation (if needed) and Packages::Rpm::ProcessPackageService for parsing package, updating package attributes and adding it to repository metadata files. In case of destruction, it calls Packages::Rpm::DestroyPackageService for removing repository files if the last package is removed.

Screenshots or screen recordings

Screenshot_2022-11-10_at_18.15.24 Screenshot_2022-11-10_at_18.19.15 Screenshot_2022-11-10_at_18.20.36 Screenshot_2022-11-10_at_18.21.45 Screenshot_2022-11-10_at_18.21.54 Screenshot_2022-11-10_at_18.22.26 Screenshot_2022-11-10_at_18.22.40 Screenshot_2022-11-10_at_18.24.09 Screenshot_2022-11-10_at_18.24.52

How to set up and validate locally

For testing locally disable authentication by removing code from rpm_project_packages.rb:18 and adding authenticate_non_get! to before block

#remove these
authenticate_with do |accept|
  accept.token_types(:personal_access_token_with_username, :deploy_token_with_username, :job_token_with_username)
        .sent_through(:http_basic_auth)
end
#add this
before do
  require_packages_enabled!

  not_found! unless ::Feature.enabled?(:rpm_packages, authorized_user_project)

  authorize_read_package!(authorized_user_project)
end

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #372737

Edited by Maksym Shabelnyk

Merge request reports