build log --follow, streamed to the build page #250

closed cmc opened this on 2026-09-23 05:18 UTC

Discussion

cmc 2026-09-23 05:18 UTC

No surface can follow a running build: build log prints what is stored and exits, and the build page renders the log once.

Add build log <owner/name> <n> --follow as the capability, and have the web page stream it without JavaScript.

  • Log fan-out: the server receives the runner's log over SSH and stores it; followers need to be woken on each appended chunk rather than re-reading the stored log.
  • --follow: print what is stored, then new output until the build reaches an outcome, then the outcome.
  • Web: a chunked response that writes the page through <pre class="code buildlog">, flushes each chunk, and closes with the outcome and the footer. compress.go's gzip writer must flush per chunk.
  • An explicit end line ("build finished: success"), since the status chip rendered at the top cannot change; a dropped stream shows a reconnect link instead, so it never reads as finished.
  • Server write timeouts that tolerate long silent steps; a cap on concurrent followers per account.

Chosen over a Refresh header: live output, no reloads interrupting selection or screen readers, each byte sent once instead of the whole log per reload per viewer, and it lands as a control command every surface shares.

referenced in commit fde83cbf5f by cmc: e2e: the cancel test reads live build pages with follow=0

2026-09-23 06:40 UTC

referenced in commit f8c1e35051 by cmc: docs: queued follows, proxies

2026-09-23 06:40 UTC

referenced in commit 3ac40e6851 by cmc: build log --follow: end a queued follow, stream only on GET

2026-09-23 06:40 UTC

closed by cmc in commit be53d945d3: wiki: build log --follow

2026-09-23 06:40 UTC

referenced in commit cdd8d0e2f4 by cmc: e2e: kill the followed ssh process when the test fails

2026-09-23 06:40 UTC

referenced in commit 55165106cd by cmc: e2e: follow a running build over ssh and on its page

2026-09-23 06:40 UTC

referenced in commit ced25dc192 by cmc: web: the build page streams a live build's log

2026-09-23 06:40 UTC

referenced in commit 97b29c8fac by cmc: httpd: gzipWriter passes a flush through

2026-09-23 06:40 UTC

referenced in commit a582e3d398 by cmc: sshd, api: end a command when its reader goes away

2026-09-23 06:40 UTC

referenced in commit eed104c810 by cmc: build log --follow: stream a build's log until it ends

2026-09-23 06:40 UTC

referenced in commit ea2aad2524 by cmc: store: wake build log followers, read the log from an offset

2026-09-23 06:40 UTC

referenced in commit a5e20608fa by cmc: plan: build log --follow

2026-09-23 06:40 UTC

referenced in commit f84f577ef1 by cmc: spec: build log --follow

2026-09-23 06:40 UTC

referenced in commit 9eb3eb0b80 by cmc: CHANGELOG: v1.35.0

2026-09-23 07:21 UTC