Skip to content

Add sync worker for advisories

Igor Frenkel requested to merge 370780-add-advisories-sync-worker into master

What does this MR do and why?

Adds worker for importing advisory package metadata.

Notable changes:

  • Worker
    • Renames existing sync worker to licenses
    • Adds worker for advisories similar to above
    • Extract stop signal into its own class and allow sync service to instantiate it
    • ExclusiveLease passed to sync service
  • Sync Service
  • Sync Config
    • Check whether old offline path is available for licenses
  • Feature flag to control ingestio

Changelog: added

How to set up and validate locally

See here.

Or:

  1. bundle exec rails console
  2. ENV['PM_SYNC_IN_DEV'] = 'true'
  3. ::License.feature_available?(:dependency_scanning) should evaluate to true
  4. PackageMetadata::AdvisoriesSyncWorker.new.perform should generate calls to gcp bucket and error out with NoMethodError from AdvisoryIngestionService since it is being added in !123149 (merged)

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 #370780 (closed)

Edited by Igor Frenkel

Merge request reports