Skip to content

Commit ce00ed9

Browse files
committed
fix: making advisories packages alive
1 parent a376c12 commit ce00ed9

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

modules/fundamental/src/purl/service/gc_purls.sql

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
WITH
22
alive_qualified_purl AS (
3-
SELECT DISTINCT t2.id, t2.versioned_purl_id
3+
(
4+
SELECT t2.id, t2.versioned_purl_id
45
FROM sbom_package_purl_ref AS t1
56
INNER JOIN qualified_purl AS t2
67
ON t2.id = t1.qualified_purl_id
8+
)
9+
UNION
10+
(
11+
SELECT t1.id, t1.versioned_purl_id
12+
FROM qualified_purl AS t1
13+
INNER JOIN versioned_purl AS t2 ON t2.id = t1.versioned_purl_id
14+
INNER JOIN (
15+
SELECT DISTINCT base_purl_id
16+
FROM purl_status
17+
) AS t3 ON t2.base_purl_id = t3.base_purl_id
18+
)
719
),
820
alive_versioned_purl AS (
921
SELECT DISTINCT t2.id, t2.base_purl_id

modules/fundamental/src/purl/service/test.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,6 @@ async fn gc_purls_from_single_csaf(ctx: &TrustifyContext) -> Result<(), anyhow::
816816
.len()
817817
);
818818

819-
// should any packages be garbage collected? I honestly don't know.
820819
assert_eq!(0, purl_service.gc_purls(&ctx.db).await?);
821820

822821
Ok(())

0 commit comments

Comments
 (0)