Skip to content

feat: Decompose sbom_source_packages from sbom_occurrences

Lucas Charles requested to merge decompose-sbom_source_packages into master

What does this MR do and why?

Transition sbom_source_packages to loose foreig... (#469539 - closed)

  • Moves sbom_source_packages table to gitlab_sec DB
  • Updates sbom_occurrences.source_package_id fkey to allowlist cross database joins

Allowing cross DB joins is a temporary measure until we can migrate the sbom_occurrences table to the gitlab_sec DB as well, see parent epic for full scope of effort

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

This is somewhat involved but can be tested as described:

  1. gitlab_sec DB can be enabled in GDK as either an independent database or the default behavior, falling back to using the main DB
    1. gdk config set gitlab.rails.databases.sec.enabled true
    2. gdk reconfigure
    3. rake db:create db:migrate
  2. Ingest an SBOM report. Easiest way is using a fixture by setting the file as a CI job cyclonedx report artifact to be uploaded directly:
      gemnasium-dependency_scanning:
        stage: test
        script: 'pwd'
        artifacts:
          reports:
            cyclonedx: "**/gl-sbom-*.cdx.json"
  3. Ensure pipeline has completed successfully and sidekiq jobs have completed
  4. Check Project dependency list for results
Edited by Lucas Charles

Merge request reports