From 0d6bbec9f35b6be890ec1e826d233c353638d1de Mon Sep 17 00:00:00 2001 From: yuyr Date: Tue, 28 Jul 2026 10:32:18 +0800 Subject: [PATCH] =?UTF-8?q?20260728=20=E4=BF=AE=E5=A4=8DExplorer=20Reject?= =?UTF-8?q?=20reasons=E7=BB=9F=E8=AE=A1=E8=AF=AD=E4=B9=89=EF=BC=9Areason?= =?UTF-8?q?=5Fcounts=E4=BB=85=E7=BB=9F=E8=AE=A1error=E5=AF=B9=E8=B1=A1deta?= =?UTF-8?q?il(#133)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/query/report_stream.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/query/report_stream.rs b/src/query/report_stream.rs index 62f41ed..d77d94a 100644 --- a/src/query/report_stream.rs +++ b/src/query/report_stream.rs @@ -613,15 +613,15 @@ impl<'de> Deserialize<'de> for ObjectStatsSeq { stats.count += 1; if object.result == "error" { stats.rejected += 1; + if let Some(detail) = object.detail.filter(|value| !value.is_empty()) { + bump_limited_count(&mut stats.reason_counts, &detail, 512); + } } *stats .object_type_counts .entry(object.object_type) .or_default() += 1; *stats.result_counts.entry(object.result).or_default() += 1; - if let Some(detail) = object.detail.filter(|value| !value.is_empty()) { - bump_limited_count(&mut stats.reason_counts, &detail, 512); - } } Ok(ObjectStatsSeq(stats)) } @@ -1375,7 +1375,7 @@ mod tests { "repo_terminal_state":"fresh", "warnings":[], "objects":[ - {"rsync_uri":"rsync://repo.example/rpki/m.mft","sha256_hex":"11","kind":"manifest","result":"ok"}, + {"rsync_uri":"rsync://repo.example/rpki/m.mft","sha256_hex":"11","kind":"manifest","result":"ok","detail":"restored child CA instance from publication-point cache"}, {"rsync_uri":"rsync://repo.example/rpki/a.roa","sha256_hex":"22","kind":"roa","result":"error","detail":"bad roa"} ] }], @@ -1401,6 +1401,13 @@ mod tests { assert_eq!(summary.aspas_count, 1); assert_eq!(summary.stats.object_type_counts["roa"], 1); assert_eq!(summary.stats.reason_counts["bad roa"], 1); + // #133: informational detail on non-error objects must not be counted + // as reject reasons. + assert_eq!(summary.stats.reason_counts.len(), 1); + assert!(!summary + .stats + .reason_counts + .contains_key("restored child CA instance from publication-point cache")); let page = list_report_objects(&report_path, "run_0001", ObjectScope::All, 1, None).expect("page");