From f58d7dfbc40f63c678e243de37032da858774d64 Mon Sep 17 00:00:00 2001 From: JimFuller-RedHat Date: Wed, 11 Sep 2024 20:25:20 +0200 Subject: [PATCH] fix hashmap key mangling on analysis service invoke --- modules/ingestor/src/service/mod.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/ingestor/src/service/mod.rs b/modules/ingestor/src/service/mod.rs index 56df315f..9fcb27e2 100644 --- a/modules/ingestor/src/service/mod.rs +++ b/modules/ingestor/src/service/mod.rs @@ -180,19 +180,21 @@ impl IngestorService { match fmt { Format::SPDX | Format::CycloneDX => { let analysis_service = AnalysisService::new(self.graph.db.clone()); - match analysis_service - .load_graphs(vec![result.id.value()], ()) - .await - { - Ok(_) => log::debug!( + if result.id.to_string().starts_with("urn:uuid:") { + match analysis_service // TODO: today we chop off 'urn:uuid:' prefix using .split_off on result.id + .load_graphs(vec![result.id.to_string().split_off("urn:uuid:".len())], ()) + .await + { + Ok(_) => log::debug!( "Analysis graph for sbom: {} loaded successfully.", result.id.value() ), - Err(e) => log::warn!( + Err(e) => log::warn!( "Error loading sbom {} into analysis graph : {}", result.id.value(), e ), + } } } _ => {}