git-ents.gitmain
⌘K
foforge
commit 9095310
feat: show when each check ran and how long it took

Checks on HEAD and Recent runs gave no sense of recency or cost: a visitor could not tell whether a result was from the last push or last week, or whether a check was fast or slow. Checks on HEAD now shows the run age in its header, Recent runs shows it per row, and each outcome shows its duration when the runner recorded one.

Assisted-by: Claude:claude-sonnet-5

Joseph D. Carpinelli · 1 month ago

Reviews

No reviews of this commit yet — record a verdict below.

Start a review

verdict

crates/git-ents-server/src/web/pages.rs @@ -967,7 +967,12 @@ "each run is recorded under " code { "refs/meta/results/<effect>/<commit>" } "." } div.card { - div.card-header { "Checks on HEAD" } + div.card-header { + "Checks on HEAD" + @if let Some(run) = head_run { + span.muted { " · " (ago_seconds(i64::try_from(run.at).unwrap_or(i64::MAX))) } + } + } @match &checks { Err(err) => div.card-row.muted { "Could not read checks: " (err) } Ok(checks) if checks.is_empty() => { @@ -999,6 +1004,9 @@ div.card-row.signer-row { code.key { (short_oid(&commit.commit)) } (super::render::run_row(rel, &commit.commit.to_string(), run)) + span.muted { + (ago_seconds(i64::try_from(run.at).unwrap_or(i64::MAX))) + } } } }
crates/git-ents-server/src/web/render.rs @@ -177,11 +177,18 @@ /// recording behind it. fn run_result(rel: &str, commit_hex: &str, outcome: &RunOutcome) -> Markup { let href = format!("/{rel}/checks/{commit_hex}/{}", outcome.name); + let duration = html! { + @if let Some(secs) = outcome.duration_secs { + " " span.muted { "(" (secs) "s)" } + } + }; html! { @if outcome.recording.is_some() || is_in_progress(outcome.status) { a.run-result href=(href) { (outcome.name) " " (status_badge(outcome.status)) } + (duration) } @else { span.run-result { (outcome.name) " " (status_badge(outcome.status)) } + (duration) } } }