Introduce LicenseV3SyncService for package licenses
What does this MR do and why?
Note
Review this after Extract V3SyncService from the malware sync ser... (!251813 - merged) • Orin Naaman • 19.4, which extracted PackageMetadata::V3SyncService as a base class.
-
Adds
PackageMetadata::LicenseV3SyncService, a subclass ofV3SyncService. -
Pacing carries over from v2
SyncService:MAX_LEASE_LENGTH5 minutes,MAX_SYNC_DURATION4 minutes,INGEST_SLICE_SIZE200,THROTTLE_RATE0.75 seconds. v3 covers the same packages as v2, only with expressions added, so the v2 values already hold at this volume. -
MAX_LEASE_LENGTHis 5 minutes, not 6 likeSyncService, becauseV3SyncServicerequires it to matchLicensesSyncWorker::LEASE_TIMEOUT. -
Ingestion::CompressedPackage::IngestionService#executenow returnstrue, the same asMalwareAdvisoryIngestionService.V3SyncServicereads that value as "was this slice saved?" and only moves the checkpoint forward when every slice says yes.- It was returning the transaction's value, a list of saved rows. Ruby reads any list as true, so the check passed by luck rather than by contract.
Note
This code is dormant and cannot silently do the wrong thing. LicensesSyncWorker still runs SyncService, so nothing calls it. If a worker pointed here today, validate_v3_configs! would raise, since license_configs still emits v2. The two hooks whose collaborators are not v3-ready raise as well, rather than falling back to a v2 reader. Specs pin all three.
Not in this MR
- The v3 parse path:
fabricator_classraisesNotImplementedError.DataObjectFabricatorhas no v3 branch, so routing v3 through it would hand every record to the v1DataObject, drop it, and let the checkpoint advance. The branch and the v3 data object land in Ingest v3 PMDB license data via new spdx_expres... (!250674 - merged) • Igor Frenkel • 19.4. - The offline connector:
offline_connector_classraises too. as no v3 offline connector exists for licenses yet.