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.
Tighten the run page's logs and summary cards
8015a72b322328c3c5b8c3b5f8ca6fcd17c57695 · Keenan Nemetz · 17d ago · parent e653853a
Tighten the run page's logs and summary cards
Return the run page's step logs to a collapsible accordion. The tab bar
replaced a stack that already read well, and it hid every step's output behind
one shared pane. Each step now loads its own byte range when opened, the step a
reader should land on opens itself, and a record without per-step ranges falls
back to the attempt's full log instead of a stack of empty rows. Drop the
unused /runs/{id}/steps fragment and the tab-only view fields.
Stop stretching the summary cards to the tallest one, and trim their subtext:
the workflow card links the definition without repeating its path, "acted as"
and "reported by" lose their explanations, and only a successful run that does
not gate a branch explains why it is not a check.
server/web/templates/run.html +36−31
| @@ -58,7 +58,7 @@ | |||
| 58 | 58 | <div class="card"> | |
| 59 | 59 | <span class="run-summary-label">{{icon "history"}}Queue wait</span> | |
| 60 | 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> | |
| 61 | <span class="status-note">{{if .Run.Started.IsZero}}so far{{else}}before the first runner leased it{{end}}</span> | ||
| 61 | <span class="status-note">{{if .Run.Started.IsZero}}so far{{else}}before it started{{end}}</span> | ||
| 62 | 62 | </div> | |
| 63 | 63 | <div class="card"> | |
| 64 | 64 | <span class="run-summary-label">{{icon "server"}}Environment</span> | |
| @@ -70,14 +70,13 @@ | |||
| 70 | 70 | <span class="run-summary-label">{{icon "git-commit-horizontal"}}Commit</span> | |
| 71 | 71 | <strong><a class="sha" href="/{{.Name}}/commit/{{.Run.SHA}}">{{short .Run.SHA}}</a></strong> | |
| 72 | 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}} | ||
| 73 | {{if .CountsWhy}}<span class="status-note">not a check: {{.CountsWhy}}</span>{{end}} | ||
| 74 | 74 | </div> | |
| 75 | 75 | <div class="card"> | |
| 76 | 76 | <span class="run-summary-label">{{icon "file-code"}}Workflow</span> | |
| 77 | 77 | <strong><a href="/{{.Name}}/blob/{{.Run.SHA}}/{{pathurl .Run.Workflow}}">{{.Run.WorkflowTitle}}</a></strong> | |
| 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}} | ||
| 78 | {{if .Run.Bot}}<span class="status-note">acted as <strong>{{.Run.Bot}}</strong></span>{{end}} | ||
| 79 | {{if .Attestation}}<span class="status-note">reported by <strong>{{.Signer}}</strong></span>{{end}} | ||
| 81 | 80 | </div> | |
| 82 | 81 | </div> | |
| 83 | 82 | ||
| @@ -87,11 +86,39 @@ | |||
| 87 | 86 | {{range .Logs}}<a class="chip" href="/{{$.Name}}/runs/{{$.Run.ID}}/log?attempt={{.Attempt}}">{{icon "file"}}attempt {{.Attempt}}</a> {{end}} | |
| 88 | 87 | </div>{{end}} | |
| 89 | 88 | <div class="card run-log-card"> | |
| 90 | {{template "run_step_tabs" .}} | ||
| 91 | 89 | {{if .Live}} | |
| 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> | ||
| 90 | <details class="run-log run-log-live" open> | ||
| 91 | <summary> | ||
| 92 | {{icon "terminal"}}<span class="run-log-title">Job output</span> | ||
| 93 | <span class="run-log-meta">attempt {{.LogAttempt}} · <span class="run-log-state">live</span></span> | ||
| 94 | </summary> | ||
| 95 | <pre class="run-log-text" data-log-stream | ||
| 96 | data-log-url="/{{.Name}}/runs/{{.Run.ID}}/log?attempt={{.LogAttempt}}" | ||
| 97 | data-log-final="0"></pre> | ||
| 98 | </details> | ||
| 99 | {{end}} | ||
| 100 | {{if .FullLogURL}} | ||
| 101 | <details class="run-log" open hx-get="{{.FullLogURL}}" hx-trigger="load once" hx-target="find pre" hx-swap="textContent"> | ||
| 102 | <summary> | ||
| 103 | {{icon "terminal"}}<span class="run-log-title">Job output</span> | ||
| 104 | <span class="run-log-meta">attempt {{.LogAttempt}}</span> | ||
| 105 | </summary> | ||
| 106 | <pre class="run-log-text"></pre> | ||
| 107 | </details> | ||
| 108 | {{end}} | ||
| 109 | {{range .Steps}} | ||
| 110 | {{/* The step a reader should land on opens and loads itself; every other step | ||
| 111 | loads its own byte range the first time it is opened. */}} | ||
| 112 | {{$default := and (not $.Live) .LogURL (eq .LogURL $.DefaultLogURL)}} | ||
| 113 | <details class="run-log{{if .LogURL}} run-step-log{{end}}"{{if .LogURL}} hx-get="{{.LogURL}}" hx-trigger="{{if $default}}load once{{else}}toggle once{{end}}" hx-target="find pre" hx-swap="textContent"{{end}}{{if $default}} open{{end}}> | ||
| 114 | <summary> | ||
| 115 | <span class="run-step-num">{{.Number}}</span> | ||
| 116 | <span class="run-step-name">{{.Name}}</span> | ||
| 117 | <span class="status {{.Status}}">{{.Label}}</span> | ||
| 118 | <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> | ||
| 119 | </summary> | ||
| 120 | {{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 .Label "pending"}}Waiting for this step.{{else if eq .Label "waiting"}}Waiting for this step.{{else if eq .Label "queued"}}Waiting for a runner.{{else if eq .Label "not run"}}Not run.{{else}}No output was captured for this step.{{end}}</p>{{end}} | ||
| 121 | </details> | ||
| 95 | 122 | {{end}} | |
| 96 | 123 | </div> | |
| 97 | 124 | {{else}} | |
| @@ -121,25 +148,3 @@ instance's content-addressed store, and are swept only when nothing names them.< | |||
| 121 | 148 | ||
| 122 | 149 | {{template "footer" .}} | |
| 123 | 150 | {{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}} | ||