fix(scans): the overview and target list split an old run's notes too
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 10m9s
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 10m9s
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:
1 parent
e53f047289
commit
56cb388e61
3 files changed
+12
-4
No files matched your search
@@ -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()
|
||||
|
||||
@@ -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)]
|
||||
|
||||
Reference in new issue
Block a user