Use database for dependencies API
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.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Import this project: https://gitlab.com/gitlab-org/govern/threat-insights-demos/verification-projects/verify-408846-group/verify-408849-project
- Enable the feature flag
echo 'Feature.enable(:use_database_for_dependencies_api)' | bundle exec rails c
- Run a pipeline on the project and wait for it to complete
- Go to
<gdk_url>/api/v4/:project_id/dependencies
- Dependencies are rendered
Edited by Brian Williams