From eef73decb5b1dde060d8da1bc29782efeea15135 Mon Sep 17 00:00:00 2001 From: teernisse Date: Sat, 14 Feb 2026 11:25:33 -0500 Subject: [PATCH] fix(cli): timeline tag width, test env isolation, and logging verbosity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Miscellaneous fixes across CLI and core modules: - Timeline: widen TAG_WIDTH from 10 to 11 to accommodate longer event type labels without truncation - render.rs: save and restore LORE_ICONS env var in glyph_mode test to prevent interference from the test environment leaking into or from other tests that set LORE_ICONS - logging.rs: adjust verbose=1 to info level (was debug), verbose=2 to debug — this reduces noise at -v while keeping -vv as the full debug experience - issues.rs, merge_requests.rs: use infodebug! macro consistently for ingestion summary logging Co-Authored-By: Claude Opus 4.6 --- src/cli/commands/timeline.rs | 2 +- src/cli/render.rs | 10 +++++++++- src/core/logging.rs | 4 ++-- src/ingestion/issues.rs | 6 +++--- src/ingestion/merge_requests.rs | 6 +++--- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/cli/commands/timeline.rs b/src/cli/commands/timeline.rs index 7afda42..fb4b94d 100644 --- a/src/cli/commands/timeline.rs +++ b/src/cli/commands/timeline.rs @@ -301,7 +301,7 @@ fn print_timeline_footer(result: &TimelineResult) { } /// Format event tag: pad plain text to TAG_WIDTH, then apply style. -const TAG_WIDTH: usize = 10; +const TAG_WIDTH: usize = 11; fn format_event_tag(event_type: &TimelineEventType) -> String { let (label, style) = match event_type { diff --git a/src/cli/render.rs b/src/cli/render.rs index ad41975..c29b97e 100644 --- a/src/cli/render.rs +++ b/src/cli/render.rs @@ -1254,7 +1254,15 @@ mod tests { #[test] fn glyph_mode_force_ascii_is_fallback_when_no_explicit_icon_mode() { - assert_eq!(GlyphMode::detect(None, true), GlyphMode::Ascii); + // Clear env var so it doesn't short-circuit the force_ascii path. + // SAFETY: tests run single-threaded per process for env-var-dependent tests. + let saved = std::env::var("LORE_ICONS").ok(); + unsafe { std::env::remove_var("LORE_ICONS") }; + let result = GlyphMode::detect(None, true); + if let Some(v) = saved { + unsafe { std::env::set_var("LORE_ICONS", v) }; + } + assert_eq!(result, GlyphMode::Ascii); } #[test] diff --git a/src/core/logging.rs b/src/core/logging.rs index 812a835..3481ee3 100644 --- a/src/core/logging.rs +++ b/src/core/logging.rs @@ -51,8 +51,8 @@ pub fn build_stderr_filter(verbose: u8, quiet: bool) -> EnvFilter { } let directives = match verbose { - 0 => "lore=info,warn", - 1 => "lore=debug,warn", + 0 => "lore=warn", + 1 => "lore=info,warn", 2 => "lore=debug,info", _ => "lore=trace,debug", }; diff --git a/src/ingestion/issues.rs b/src/ingestion/issues.rs index 7e75459..cd912c9 100644 --- a/src/ingestion/issues.rs +++ b/src/ingestion/issues.rs @@ -2,7 +2,7 @@ use std::ops::Deref; use futures::StreamExt; use rusqlite::{Connection, Transaction}; -use tracing::{debug, info, warn}; +use tracing::{debug, warn}; use crate::Config; use crate::core::error::{LoreError, Result}; @@ -61,7 +61,7 @@ pub async fn ingest_issues( while let Some(issue_result) = issues_stream.next().await { if signal.is_cancelled() { - info!("Issue ingestion interrupted by shutdown signal"); + debug!("Issue ingestion interrupted by shutdown signal"); break; } let issue = issue_result?; @@ -108,7 +108,7 @@ pub async fn ingest_issues( result.issues_needing_discussion_sync = get_issues_needing_discussion_sync(conn, project_id)?; - info!( + debug!( summary = crate::ingestion::nonzero_summary(&[ ("fetched", result.fetched), ("upserted", result.upserted), diff --git a/src/ingestion/merge_requests.rs b/src/ingestion/merge_requests.rs index f1d9f0b..0d1453e 100644 --- a/src/ingestion/merge_requests.rs +++ b/src/ingestion/merge_requests.rs @@ -1,7 +1,7 @@ use std::ops::Deref; use rusqlite::{Connection, Transaction, params}; -use tracing::{debug, info, warn}; +use tracing::{debug, warn}; use crate::Config; use crate::core::error::{LoreError, Result}; @@ -61,7 +61,7 @@ pub async fn ingest_merge_requests( loop { if signal.is_cancelled() { - info!("MR ingestion interrupted by shutdown signal"); + debug!("MR ingestion interrupted by shutdown signal"); break; } let page_result = client @@ -121,7 +121,7 @@ pub async fn ingest_merge_requests( } } - info!( + debug!( summary = crate::ingestion::nonzero_summary(&[ ("fetched", result.fetched), ("upserted", result.upserted),