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/integration_test.go +35−7
| @@ -3147,14 +3147,14 @@ jobs: | |||
| 3147 | 3147 | t.Fatalf("range request = %d, Content-Range %q", resp.StatusCode, resp.Header.Get("Content-Range")) | |
| 3148 | 3148 | } | |
| 3149 | 3149 | // Attribution is the boundary's, and the page says who it accepted the result from. | |
| 3150 | // A finished run shows each step once; the whole log is a download, not a second | ||
| 3151 | // copy of every step's output in an accordion above them. | ||
| 3150 | // A finished run shows the step tabs and one log pane; the whole log is a | ||
| 3151 | // download, not a second copy of every step's output. | ||
| 3152 | 3152 | if _, page := f.get("/" + f.repo + "/runs/" + done.ID); !strings.Contains(page, "reported by") || | |
| 3153 | 3153 | !strings.Contains(page, "say hello") || !strings.Contains(page, "step=1") || | |
| 3154 | 3154 | !strings.Contains(page, "Download full log") || !strings.Contains(page, "download=1") { | |
| 3155 | 3155 | t.Fatalf("the run page does not show the result, the step log, or the full-log download:\n%s", page) | |
| 3156 | } else if strings.Contains(page, "data-log-stream") { | ||
| 3157 | t.Fatalf("the finished run page still shows the full live log viewer:\n%s", page) | ||
| 3156 | } else if strings.Contains(page, "data-live-step-log") { | ||
| 3157 | t.Fatalf("the finished run page still shows the live step viewer:\n%s", page) | ||
| 3158 | 3158 | } | |
| 3159 | 3159 | if done.SHA != mustSHA(t, work) { | |
| 3160 | 3160 | t.Fatalf("run recorded sha %s, want the pushed commit", done.SHA) | |
| @@ -3204,9 +3204,22 @@ jobs: | |||
| 3204 | 3204 | } | |
| 3205 | 3205 | time.Sleep(100 * time.Millisecond) | |
| 3206 | 3206 | } | |
| 3207 | if _, page := f.get("/" + f.repo + "/runs/" + run.ID); !strings.Contains(page, "data-log-stream") || | ||
| 3208 | !strings.Contains(page, "Job output") || !strings.Contains(page, "slow") { | ||
| 3209 | t.Fatalf("the running run page does not show the live log viewer or step accordion:\n%s", page) | ||
| 3207 | if _, page := f.get("/" + f.repo + "/runs/" + run.ID); !strings.Contains(page, "data-live-step-log") || | ||
| 3208 | !strings.Contains(page, "run-live-steps") || !strings.Contains(page, "slow") { | ||
| 3209 | t.Fatalf("the running run page does not show the live step viewer:\n%s", page) | ||
| 3210 | } | ||
| 3211 | if _, steps := f.get("/" + f.repo + "/runs/" + run.ID + "/steps"); !strings.Contains(steps, `data-step-status="running"`) || | ||
| 3212 | !strings.Contains(steps, `hx-trigger="every 2s"`) { | ||
| 3213 | t.Fatalf("the live step fragment does not show the running step:\n%s", steps) | ||
| 3214 | } | ||
| 3215 | // The selected step is its own byte range, not the whole attempt log. | ||
| 3216 | if _, stepLog := f.get("/" + f.repo + "/runs/" + run.ID + "/log?attempt=1&step=1"); !strings.Contains(stepLog, "first line") { | ||
| 3217 | t.Fatalf("the running step log = %q", stepLog) | ||
| 3218 | } | ||
| 3219 | // A tail request is clamped to the step's range, so the live viewer starts at | ||
| 3220 | // the step even if its own offset is still zero. | ||
| 3221 | if _, stepTail := f.get("/" + f.repo + "/runs/" + run.ID + "/log?attempt=1&step=1&after=0"); !strings.Contains(stepTail, "first line") { | ||
| 3222 | t.Fatalf("the running step tail = %q", stepTail) | ||
| 3210 | 3223 | } | |
| 3211 | 3224 | // The live viewer polls; a running attempt must not claim the log is final. | |
| 3212 | 3225 | resp, err := http.Get(f.http.URL + "/" + f.repo + "/runs/" + run.ID + "/log?after=0") | |
| @@ -3236,6 +3249,21 @@ jobs: | |||
| 3236 | 3249 | t.Fatalf("a finished attempt's log is not marked final") | |
| 3237 | 3250 | } | |
| 3238 | 3251 | resp.Body.Close() | |
| 3252 | resp, err = http.Get(f.http.URL + "/" + f.repo + "/runs/" + done.ID + "/log?attempt=1&step=1") | ||
| 3253 | if err != nil { | ||
| 3254 | t.Fatal(err) | ||
| 3255 | } | ||
| 3256 | if final := resp.Header.Get("X-Step-Final"); final != "1" { | ||
| 3257 | t.Fatalf("a finished step is not marked final") | ||
| 3258 | } | ||
| 3259 | resp.Body.Close() | ||
| 3260 | |||
| 3261 | // Once the attempt is recorded the live rows are gone and the fragment stops | ||
| 3262 | // polling; the page is a finished run from here. | ||
| 3263 | if _, steps := f.get("/" + f.repo + "/runs/" + done.ID + "/steps"); !strings.Contains(steps, `data-step-status="success"`) || | ||
| 3264 | strings.Contains(steps, `hx-trigger="every 2s"`) { | ||
| 3265 | t.Fatalf("the finished step fragment still looks live:\n%s", steps) | ||
| 3266 | } | ||
| 3239 | 3267 | } | |
| 3240 | 3268 | ||
| 3241 | 3269 | // A workflow can name a definition under .vole/images. The queue pins the | |