Deactivate mirrors for projects without license
What does this MR do and why?
- Contributes to #216783 (closed)
- Incident: gitlab-com/gl-infra/production#7420 (closed)
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
How to set up and validate locally
- Enable the feature flag
Feature.enable(:hard_failure_for_mirrors_without_license)
- You need a public project without
legacy_open_source_license
(project.project_setting.legacy_open_source_license_available? => false
) - Run
UpdateAllMirrorsWorker.new.perform
from Rails console - 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Mayra Cabrera