Skip to content

Deactivate mirrors for projects without license

What does this MR do and why?

Problem

Projects without a correct license are picked up by UpdateAllMirrorsWorker but we skip their processing. It increases amount of work for the worker and impacts the performance.

Solution

Mark projects without a license as hard failed to exclude them from the UpdateAllMirrorsWorker query.

Screenshots or screen recordings

Screenshot_2022-07-14_at_14.44.41

How to set up and validate locally

  1. Enable the feature flag
    Feature.enable(:hard_failure_for_mirrors_without_license)
  2. You need a public project without legacy_open_source_license (project.project_setting.legacy_open_source_license_available? => false)
  3. Run UpdateAllMirrorsWorker.new.perform from Rails console
  4. The project import state must be failed with retry count equal 15
     => #<ProjectImportState:0x00007fd1f5216050
       ...
       retry_count: 15,
       status: "failed",
       last_error: "Project mirroring is not supported",
       ...

MR acceptance checklist

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

Edited by Mayra Cabrera

Merge request reports

Loading