Say what a database or log target's attempt did, without a status (closes #388)
check / check (push) Successful in 3m20s

A database or log target sends no HTTP request, yet each of its attempts
read "success  Status: — (no response)", which for an http target means
a failed connection. The shared attempt template now reads a successful
database attempt as "archived" and a successful log attempt as "written
to the log", and shows no status for either, in the event log and on the
event's page. http and slack attempts are unchanged. One test per target
type, plus one for a failed database attempt, checks both pages.

Model: opus-5-5
This commit is contained in:
2026-10-03 00:33:24 +00:00
committed by sneak
parent f1da5e73dd
commit 8514c1e042
3 changed files with 98 additions and 1 deletions
+5 -1
View File
@@ -5,11 +5,15 @@
<p class="text-xs text-gray-500">{{.AttemptsOmitted}} attempt{{if ne .AttemptsOmitted 1}}s{{end}} omitted between the first and last shown.</p>
{{end}}
{{range .Results}}
{{/* Inside this loop, dot is one attempt and $ the whole delivery. */}}
<div class="rounded-md bg-white border border-gray-200 p-2">
<div class="flex flex-wrap items-center gap-3 text-xs">
<span class="text-gray-500">Attempt {{.AttemptNum}}</span>
<span class="{{if .Success}}text-green-600{{else}}text-red-600{{end}}">{{if .Success}}success{{else}}failure{{end}}</span>
<span class="{{if .Success}}text-green-600{{else}}text-red-600{{end}}">{{if not .Success}}failure{{else if eq $.Target.Type "database"}}archived{{else if eq $.Target.Type "log"}}written to the log{{else}}success{{end}}</span>
{{/* A database or log target sends no HTTP request, so its attempts have no status code. */}}
{{if not (eq $.Target.Type "database" "log")}}
<span class="text-gray-500">Status: {{if .HasStatusCode}}{{.StatusCode}}{{else}}&mdash; (no response){{end}}</span>
{{end}}
<span class="text-gray-500">Duration: {{.DurationMS}} ms</span>
</div>
{{if .Error}}