Skip to content

Commit 375e996

Browse files
committed
Use LeftJoin instead and change test 'cause order_by_adc
1 parent 58d6319 commit 375e996

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

modules/fundamental/src/sbom/endpoints/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,8 @@ async fn query_sboms_by_ingested_time(ctx: &TrustifyContext) -> Result<(), anyho
282282

283283
// assert expected fields
284284
assert_eq!(all["total"], 2);
285-
assert_eq!(all["items"][0]["name"], json!("zookeeper"));
286-
assert_eq!(all["items"][1]["name"], json!("ubi9-container"));
285+
assert_eq!(all["items"][0]["name"], json!("ubi9-container"));
286+
assert_eq!(all["items"][1]["name"], json!("zookeeper"));
287287
assert_eq!(ubi["total"], 1);
288288
assert_eq!(ubi["items"][0]["name"], json!("ubi9-container"));
289289
assert_eq!(zoo["total"], 1);

modules/fundamental/src/sbom/service/sbom.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl SbomService {
131131
.distinct_on([(sbom::Entity, sbom::Column::SbomId)])
132132
.order_by_asc(sbom::Column::SbomId)
133133
.join(JoinType::Join, sbom::Relation::SourceDocument.def())
134-
.join(JoinType::Join, sbom::Relation::Packages.def()) // Use inner join for sbom_package for filtering
134+
.join(JoinType::LeftJoin, sbom::Relation::Packages.def()) // Use left join to preserve SBOMs without packages
135135
.find_also_linked(SbomNodeLink)
136136
.filtering_with(
137137
search,

0 commit comments

Comments
 (0)