Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Make run pages step-aware and easier to scan

e653853a52ede660a589caeddd1bf46d5101f853 · Keenan Nemetz · 17d ago · parent fdd0b3e8

Make run pages step-aware and easier to scan

Stream structured step events from the runner so a running attempt can show per-step tabs and tail the selected step's log. Keep one log pane for finished runs, label run timings, let queued and running durations tick client-side, and fix long branch names. Polish the runs list with filter totals, a real subtitle, and clearer stop/cancel labels.

server/web/templates/run.html +52−41

@@ -19,7 +19,7 @@
19 19 <div class="page-head-actions">
20 20 {{if .CanCancel}}<form class="inline" method="post" action="/{{.Name}}/runs/{{.Run.ID}}/cancel">
21 21 <input type="hidden" name="csrf" value="{{.CSRF}}">
22 <button type="submit" class="warn">{{icon "circle-x"}}{{if eq .Run.Status "running"}}Stop running run{{else}}Cancel queued run{{end}}</button>
22 <button type="submit" class="warn">{{icon "circle-x"}}{{if eq .Run.Status "running"}}Stop run{{else}}Cancel run{{end}}</button>
23 23 </form>{{end}}
24 24 {{if .CanRerun}}<form class="inline" method="post" action="/{{.Name}}/runs/{{.Run.ID}}/rerun">
25 25 <input type="hidden" name="csrf" value="{{.CSRF}}">
@@ -33,77 +33,65 @@
33 33 <div class="card">
34 34 <span class="run-summary-label">{{icon "history"}}Duration</span>
35 35 {{if .Run.Started.IsZero}}
36 <strong>{{duration .Wait}}</strong>
37 <span class="status-note">{{if eq .Run.Status "queued"}}waiting for a runner{{else}}queued{{end}}</span>
36 <strong>{{if .Run.Finished.IsZero}}<span data-clock-from="{{.Run.Created.Unix}}">{{duration .Wait}}</span>{{else}}{{duration .Wait}}{{end}}</strong>
38 37 {{else}}
39 <strong>{{duration .Duration}}</strong>
40 <span class="status-note">{{if .Run.Finished.IsZero}}running now{{else}}finished {{since .Run.Finished.Unix}}{{end}}</span>
38 <strong>{{if .Run.Finished.IsZero}}<span data-clock-from="{{.Run.Started.Unix}}">{{duration .Duration}}</span>{{else}}{{duration .Duration}}{{end}}</strong>
39 {{end}}
40 {{if eq .Run.Status "error"}}
41 <span class="status-note">never started</span>
42 {{else if .Run.Started.IsZero}}
43 {{if ne .Run.Status "canceled"}}
44 <span class="status-note">{{if eq .Run.Status "queued"}}waiting for a runner{{else}}queued{{end}}</span>
45 {{end}}
46 {{else}}
47 <span class="status-note">{{if .Run.Finished.IsZero}}running now{{else}}finished <span data-since="{{.Run.Finished.Unix}}">{{since .Run.Finished.Unix}}</span>{{end}}</span>
48 {{end}}
49 {{if eq .Run.Status "canceled"}}
50 <span class="status-note">{{if .Run.CancelRequested}}Stopped while running{{else}}Canceled while queued{{end}}{{if .Run.CancelActor}} by <strong>{{.Run.CancelActor}}</strong>{{end}}</span>
51 {{else if eq .Run.Status "error"}}
52 <span class="status-note">{{if .Run.FailureMessage}}the runner said <code>{{.Run.FailureMessage}}</code>{{else}}the runner did not record why{{end}}</span>
53 <span class="status-note">Re-run it once the machine can build; the commit is not what failed.</span>
54 {{else if and (eq .Run.Status "running") .Run.CancelRequested}}
55 <span class="status-note">Stopping{{if .Run.CancelActor}} at the request of <strong>{{.Run.CancelActor}}</strong>{{end}} at the runner's next heartbeat</span>
41 56 {{end}}
42 57 </div>
43 58 <div class="card">
44 59 <span class="run-summary-label">{{icon "history"}}Queue wait</span>
45 <strong>{{duration .Wait}}</strong>
60 <strong>{{if and .Run.Started.IsZero .Run.Finished.IsZero}}<span data-clock-from="{{.Run.Created.Unix}}">{{duration .Wait}}</span>{{else}}{{duration .Wait}}{{end}}</strong>
46 61 <span class="status-note">{{if .Run.Started.IsZero}}so far{{else}}before the first runner leased it{{end}}</span>
47 62 </div>
48 63 <div class="card">
49 64 <span class="run-summary-label">{{icon "server"}}Environment</span>
50 65 {{if .Run.OS}}<strong>{{.Run.OS}}/{{.Run.Arch}}</strong>{{else}}<strong class="muted">not reported</strong>{{end}}
51 <span class="status-note">{{if .Run.Image}}<code>{{if .Run.ImageFile}}{{.Run.ImageFile}}{{else}}{{.Run.Image}}{{end}}</code>{{if .Run.Runtime}} via {{.Run.Runtime}}{{end}}{{else}}no image recorded{{end}}</span>
66 <span class="status-note">{{if .Run.Image}}<code>{{if .Run.ImageFile}}{{.Run.ImageFile}}{{else}}{{.Run.Image}}{{end}}</code>{{if .Run.ImageSHA}} ({{short .Run.ImageSHA}}){{end}}{{if .Run.Runtime}} via {{.Run.Runtime}}{{end}}{{else}}no image recorded{{end}}{{if .Run.Network}} · {{if eq .Run.Network "none"}}no network{{else}}network {{.Run.Network}}{{end}}{{end}}</span>
52 67 {{if .Run.Services}}<span class="status-note">services: {{range $i, $s := .Run.Services}}{{if $i}}, {{end}}{{$s.ID}} · <code>{{$s.Image}}</code>{{end}}</span>{{end}}
53 68 </div>
54 69 <div class="card">
55 70 <span class="run-summary-label">{{icon "git-commit-horizontal"}}Commit</span>
56 71 <strong><a class="sha" href="/{{.Name}}/commit/{{.Run.SHA}}">{{short .Run.SHA}}</a></strong>
57 72 <span class="status-note">{{if .Run.Tag}}tag {{.Run.Tag}}{{else}}branch {{.Run.Branch}}{{end}}{{if eq .Run.Status "failed"}} · exit {{.Run.ExitCode}}{{end}}</span>
73 {{if .Counts}}<span class="status-note">counts as a check for this repository</span>{{else if .CountsWhy}}<span class="status-note">does not count as a check: {{.CountsWhy}}</span>{{end}}
58 74 </div>
59 75 <div class="card">
60 76 <span class="run-summary-label">{{icon "file-code"}}Workflow</span>
61 77 <strong><a href="/{{.Name}}/blob/{{.Run.SHA}}/{{pathurl .Run.Workflow}}">{{.Run.WorkflowTitle}}</a></strong>
62 78 <span class="status-note"><code>{{.Run.Workflow}}</code></span>
79 {{if .Run.Bot}}<span class="status-note">acted as <strong>{{.Run.Bot}}</strong> with a credential for this run</span>{{end}}
80 {{if .Attestation}}<span class="status-note">reported by <strong>{{.Signer}}</strong> · accepted from that runner connection</span>{{end}}
63 81 </div>
64 82 </div>
65 83
66 {{if eq .Run.Status "canceled"}}
67 <p class="muted">{{if .Run.CancelRequested}}Stopped while running{{else}}Canceled while queued{{end}}{{if .Run.CancelActor}} by <strong>{{.Run.CancelActor}}</strong>{{end}}.</p>
68 {{else if eq .Run.Status "error"}}
69 <p class="muted">This job never started, so nothing about {{short .Run.SHA}} was tested:
70 {{if .Run.FailureMessage}}the runner said <code>{{.Run.FailureMessage}}</code>.{{else}}the runner did not record why.{{end}}
71 Re-run it once the machine can build; the commit is not what failed.</p>
72 {{else if and (eq .Run.Status "running") .Run.CancelRequested}}
73 <p class="muted">Stopping{{if .Run.CancelActor}} at the request of <strong>{{.Run.CancelActor}}</strong>{{end}} at the runner's next heartbeat.</p>
74 {{end}}
75 {{if .Run.Bot}}<p class="muted">acted as <strong>{{.Run.Bot}}</strong> with a credential for this run</p>{{end}}
76 {{if .Run.OS}}<p class="muted">ran on {{.Run.OS}}/{{.Run.Arch}}{{if .Run.Image}} · in {{if .Run.ImageFile}}image-file <code>{{.Run.ImageFile}}</code> ({{short .Run.ImageSHA}}){{else}}<code>{{.Run.Image}}</code>{{end}} via {{.Run.Runtime}}{{end}}{{if .Run.Network}} · {{if eq .Run.Network "none"}}no network{{else}}network {{.Run.Network}}{{end}}{{end}}</p>{{end}}
77 {{if .Attestation}}<p class="muted">reported by <strong>{{.Signer}}</strong> · the instance accepted this result from that account's runner connection, and logged it</p>{{end}}
78 {{if .Counts}}<p class="muted">counts as a check for this repository</p>{{else if .CountsWhy}}<p class="muted">does not count as a check: {{.CountsWhy}}</p>{{end}}
79
80 84 <h2 class="with-more"><span>{{icon "terminal"}}Logs</span>{{if .HasLog}} <a class="more" href="/{{.Name}}/runs/{{.Run.ID}}/log?attempt={{.LogAttempt}}&amp;download=1">{{icon "file"}}Download full log</a>{{end}}</h2>
81 85 {{if .HasLog}}
82 86 {{if gt (len .Logs) 1}}<div class="run-logbar">
83 87 {{range .Logs}}<a class="chip" href="/{{$.Name}}/runs/{{$.Run.ID}}/log?attempt={{.Attempt}}">{{icon "file"}}attempt {{.Attempt}}</a> {{end}}
84 88 </div>{{end}}
85 89 <div class="card run-log-card">
90 {{template "run_step_tabs" .}}
86 91 {{if .Live}}
87 <details class="run-log run-log-live" open>
88 <summary>
89 {{icon "terminal"}}<span class="run-log-title">Job output</span>
90 <span class="run-log-meta">attempt {{.LogAttempt}} · <span class="run-log-state">live</span></span>
91 </summary>
92 <pre class="run-log-text" data-log-stream
93 data-log-url="/{{.Name}}/runs/{{.Run.ID}}/log?attempt={{.LogAttempt}}"
94 data-log-final="0"></pre>
95 </details>
96 {{end}}
97 {{range .Steps}}
98 <details class="run-log{{if .LogURL}} run-step-log{{end}}"{{if .LogURL}} hx-get="{{.LogURL}}" hx-trigger="toggle once" hx-target="find pre" hx-swap="textContent"{{end}}>
99 <summary>
100 <span class="run-step-num">{{.Number}}</span>
101 <span class="run-step-name">{{.Name}}</span>
102 <span class="status {{.Status}}">{{.Label}}</span>
103 <span class="run-step-meta">{{if .Duration}}{{duration .Duration}}{{else}}—{{end}}</span>
104 </summary>
105 {{if .LogURL}}<pre class="run-log-text"></pre>{{else}}<p class="run-log-empty">{{if eq .Status "running"}}This step is running; its output is in the job output above.{{else if eq .Status "pending"}}Waiting for this step.{{else if eq .Status "queued"}}Waiting for a runner.{{else if eq .Status "not run"}}Not run.{{else}}No output was captured for this step.{{end}}</p>{{end}}
106 </details>
92 <pre id="run-log-text" class="run-log-text" data-live-step-log>{{if not .DefaultLogURL}}Waiting for the first step…{{end}}</pre>
93 {{else}}
94 <pre id="run-log-text" class="run-log-text"{{if .DefaultLogURL}} hx-get="{{.DefaultLogURL}}" hx-trigger="load once" hx-swap="textContent"{{end}}>{{if not .DefaultLogURL}}No step output was captured for this run.{{end}}</pre>
107 95 {{end}}
108 96 </div>
109 97 {{else}}
@@ -130,5 +118,28 @@ instance's content-addressed store, and are swept only when nothing names them.<
130 118 {{else}}
131 119 <div class="empty-state"><p>No artifacts published by this run.</p></div>
132 120 {{end}}
121
133 122 {{template "footer" .}}
134 123 {{end}}
124
125 {{define "run_step_tabs"}}
126 <div class="run-log-steps"{{if .Live}} id="run-live-steps"{{end}}{{if .Poll}} hx-get="/{{.Name}}/runs/{{.Run.ID}}/steps" hx-trigger="every 2s" hx-swap="outerHTML"{{end}} role="tablist" aria-label="Log steps">
127 {{range .Steps}}
128 {{if .LogURL}}
129 <button type="button" class="chip run-log-step{{if eq .LogURL $.DefaultLogURL}} active{{end}}" role="tab" aria-selected="{{if eq .LogURL $.DefaultLogURL}}true{{else}}false{{end}}" aria-controls="run-log-text" data-log-step data-step-number="{{.Number}}" data-step-status="{{.Status}}" data-log-offset="{{.LogOffset}}" data-log-url="{{.LogURL}}"{{if not $.Live}} hx-get="{{.LogURL}}" hx-target="#run-log-text" hx-swap="textContent"{{end}}>
130 <span class="run-step-num">{{.Number}}</span>
131 <span class="run-log-step-name">{{.Name}}</span>
132 <span class="status {{.Status}}">{{.Label}}</span>
133 <span class="run-step-meta">{{if and (eq .Status "running") (not .Started.IsZero)}}<span data-clock-from="{{.Started.Unix}}">{{duration .Duration}}</span>{{else if .Duration}}{{duration .Duration}}{{else}}—{{end}}</span>
134 </button>
135 {{else}}
136 <span class="chip run-log-step is-empty" data-step-number="{{.Number}}" data-step-status="{{.Status}}">
137 <span class="run-step-num">{{.Number}}</span>
138 <span class="run-log-step-name">{{.Name}}</span>
139 <span class="status {{.Status}}">{{.Label}}</span>
140 <span class="run-step-meta">{{if .Duration}}{{duration .Duration}}{{else}}—{{end}}</span>
141 </span>
142 {{end}}
143 {{end}}
144 </div>
145 {{end}}