Skip to content

Fix Debian generate for group distributions

What does this MR do and why?

While investigating #393306 (closed), I found two issues:

  • Packages::Debian::GenerateDistributionWorker was picking a project distribution when called for a group distribution 😬.

    The reason is Sidekiq transforms symbols in arguments to strings (i.e. ::Packages::Debian::GenerateDistributionWorker.perform_async(:group, 42) calls ::Packages::Debian::GenerateDistributionWorker.new.perform('group', 42)

  • The lease used in Packages::Debian::GenerateDistributionService was overlaping for a group distribution having the same id as a project distribution

How to set up and validate locally

  1. Enable the invite modal

    Feature.enable(:debian_packages)
    Feature.enable(:debian_group_packages)
  2. Create a group distribution in a public group

  3. Visit "https://${SERVER}/api/v4/groups/${GROUP}/-/packages/debian/dists/${CODENAME}/Release"

    • Before the patch -> 404 Not found
    • After the patch -> A release file (a text file) 🎉

Merge request reports