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/ssh/run_test.go +49
| @@ -58,6 +58,55 @@ func TestAHeartbeatCarriesTheStopRequest(t *testing.T) { | |||
| 58 | 58 | } | |
| 59 | 59 | } | |
| 60 | 60 | ||
| 61 | // A running runner reports step boundaries on the same channel as its log. The | ||
| 62 | // event is checked against the pinned workflow and the lease, so a page can render | ||
| 63 | // a live step without trusting a name the job never asked for. | ||
| 64 | func TestStepEventsAreScopedToTheRunAndLease(t *testing.T) { | ||
| 65 | t.Parallel() | ||
| 66 | h := newHarness(t) | ||
| 67 | c := h.runner(t, h.keyPath) | ||
| 68 | run, job := h.leaseRun(t, c, "build") | ||
| 69 | |||
| 70 | started := time.Now().UTC() | ||
| 71 | ev := runs.StepEvent{ | ||
| 72 | Attempt: job.Attempt, Number: 1, Name: job.Steps[0].Name, | ||
| 73 | Status: runs.StatusRunning, Started: started, | ||
| 74 | } | ||
| 75 | if rep := c.call(runnerRequest{Op: "step", Run: job.ID, Step: &ev}); !rep.OK { | ||
| 76 | t.Fatalf("step start was refused: %+v", rep) | ||
| 77 | } | ||
| 78 | live, err := h.runs.LiveSteps(run.ID, run.Attempts) | ||
| 79 | if err != nil || len(live) != 1 || live[0].Status != runs.StatusRunning || | ||
| 80 | live[0].Name != job.Steps[0].Name { | ||
| 81 | t.Fatalf("live steps = %+v, %v", live, err) | ||
| 82 | } | ||
| 83 | |||
| 84 | // A name the workflow never pinned is not a step this run may report. | ||
| 85 | bad := ev | ||
| 86 | bad.Name = "not-the-step" | ||
| 87 | if rep := c.call(runnerRequest{Op: "step", Run: job.ID, Step: &bad}); rep.Error == "" { | ||
| 88 | t.Fatal("a step event with a made-up name was accepted") | ||
| 89 | } | ||
| 90 | // Nor is a status outside the live vocabulary. | ||
| 91 | bad = ev | ||
| 92 | bad.Status = "finished" | ||
| 93 | if rep := c.call(runnerRequest{Op: "step", Run: job.ID, Step: &bad}); rep.Error == "" { | ||
| 94 | t.Fatal("a step event with an unknown status was accepted") | ||
| 95 | } | ||
| 96 | |||
| 97 | ev.Status = runs.StatusSuccess | ||
| 98 | ev.Finished = started.Add(2 * time.Second) | ||
| 99 | ev.LogSize = 12 | ||
| 100 | if rep := c.call(runnerRequest{Op: "step", Run: job.ID, Step: &ev}); !rep.OK { | ||
| 101 | t.Fatalf("step finish was refused: %+v", rep) | ||
| 102 | } | ||
| 103 | live, err = h.runs.LiveSteps(run.ID, run.Attempts) | ||
| 104 | if err != nil || len(live) != 1 || live[0].Status != runs.StatusSuccess || | ||
| 105 | live[0].LogSize != 12 { | ||
| 106 | t.Fatalf("finished live step = %+v, %v", live, err) | ||
| 107 | } | ||
| 108 | } | ||
| 109 | |||
| 61 | 110 | // The CLI cancel asks the instance, not a clone: the queue and the access rules are | |
| 62 | 111 | // both server-side. It is the same action the browser offers, over the key the | |
| 63 | 112 | // account pushes with, and it writes the same audit record. | |