fix(scans): the overview and target list split an old run's notes too

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
This commit is contained in:
Sharang ParnerkarandClaude Opus 5.5 committed 2026-10-09 19:59:32 +02:00
1 parent aa2023d8c2
commit da11974d97
3 files changed
+12 -4

No files matched your search

+6 -1
View File
@@ -99,7 +99,12 @@ pub async fn stats_overview(
.limit(10)
.await
{
Ok(cursor) => collect_cursor_async(cursor).await,
Ok(cursor) => {
let mut runs: Vec<ScanRun> = collect_cursor_async(cursor).await;
// Runs recorded before notes existed list them among their skips.
runs.iter_mut().for_each(ScanRun::split_notes);
runs
}
Err(e) => {
tracing::warn!("Failed to fetch recent scans: {e}");
Vec::new()
@@ -200,7 +200,9 @@ pub(crate) async fn latest_scan_runs(
cursor
.filter_map(|row| async move {
let run = row.ok()?.get_document("run").ok()?.clone();
let run: ScanRun = mongodb::bson::from_document(run).ok()?;
let mut run: ScanRun = mongodb::bson::from_document(run).ok()?;
// Runs recorded before notes existed list them among their skips.
run.split_notes();
Some((run.repo_id.clone(), run))
})
.collect()
+3 -2
View File
@@ -186,8 +186,9 @@ pub struct ScanRun {
pub sbom_quality: Option<super::sbom::SbomQuality>,
}
/// Why a stage was skipped, stable for the dashboard to word in the reader's
/// language. The stage's `reason` next to it is English prose for API
/// Why a stage was skipped, or what a run note is about
/// ([`SkipCode::is_informational`]), stable for the dashboard to word in the
/// reader's language. The stage's `reason` next to it is English prose for API
/// readers; neither ever carries a server path or a raw error (those go to
/// the log).
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]