Skip to content

Update project dependencies export to filter registry related sbom occurrence

Aditya Tiwari requested to merge 443822-add-group-level-filter into master

What does this MR do and why?

Dependencies created in [CS For Registry] Set report_type to CONTAINER_... (#443821 - closed) should not appear on dependency list export file. Filter dependency report file for these dependencies.

related to: Add project level filter for dependency list (!152045 - merged)

Update project dependencies export to filter registry related sbom occurrence

Database queries

https://console.postgres.ai/gitlab/gitlab-production-main/sessions/28273/commands/88245

SELECT
    sbom_occurrences.*
FROM
    sbom_occurrences
    LEFT JOIN sbom_sources ON sbom_sources.id = sbom_occurrences.source_id
WHERE
    sbom_occurrences.project_id = 1036 AND
    (
        sbom_sources.source_type = 1 OR
        sbom_sources.source_type IS NULL
    );
 Nested Loop Left Join  (cost=0.98..2758.92 rows=505 width=570) (actual time=4.870..4.872 rows=0 loops=1)
   Filter: ((sbom_sources.source_type = 1) OR (sbom_sources.source_type IS NULL))
   Rows Removed by Filter: 0
   Buffers: shared hit=3 read=4
   I/O Timings: read=4.814 write=0.000
   ->  Index Scan using idx_sbom_occurrences_on_project_id_and_source_id on public.sbom_occurrences  (cost=0.56..939.72 rows=616 width=350) (actual time=4.869..4.870 rows=0 loops=1)
         Index Cond: (sbom_occurrences.project_id = 1036)
         Buffers: shared hit=3 read=4
         I/O Timings: read=4.814 write=0.000
   ->  Index Scan using sbom_sources_pkey on public.sbom_sources  (cost=0.42..2.94 rows=1 width=220) (actual time=0.000..0.000 rows=0 loops=0)
         Index Cond: (sbom_sources.id = sbom_occurrences.source_id)
         I/O Timings: read=0.000 write=0.000

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.

Before After

How to set up and validate locally

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

Related to #443822 (closed)

Edited by Brian Williams

Merge request reports

Loading