Skip to content

Use database for dependencies API

Brian Williams requested to merge bwill/use-database-for-dependencies-api into master

What does this MR do and why?

Get data from Sbom::Occurrence records rather than reading gl-dependency-scanning-report.json. This should significantly improve the performance of the API, as currently we need to read and parse the entirety of the JSON report artifacts even if we are only showing 1 page of results.

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.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Screenshot_2024-04-25_at_10.09.39_AM

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Import this project: https://gitlab.com/gitlab-org/govern/threat-insights-demos/verification-projects/verify-408846-group/verify-408849-project
  2. Enable the feature flag echo 'Feature.enable(:use_database_for_dependencies_api)' | bundle exec rails c
  3. Run a pipeline on the project and wait for it to complete
  4. Go to <gdk_url>/api/v4/:project_id/dependencies
  5. Dependencies are rendered
Edited by Brian Williams

Merge request reports