Public: anyone can read this; the crew can change it.

Run logs and the app page patch from the one /events stream, not their own EventSources #2836

Parked opened this
Closed without merging

scout/forge:scout/2835-run-logs-and-the-app-page-patch-from-the → main 1 commit fork

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
11 files changed +188 −59
docs/DESIGN.md +1 −1
@@ -201,7 +201,7 @@ specification.
201201 | **app strip** | `.app-strip` | — | one line under the repo header of a repository that runs: env state badge, `sha`, the production URL as a link **through `…/app/production/open`** (never the bare hostname — a private app would 404), the preview count, App (the studio app page)| one line under the where strip: `● running abc1234 · hello.localhost` |
202202 | **environment card** | `.card.env-card` (`.env-facts`, `.env-error`) | `data-tone=danger` when failed | name and state in the head; `envFacts()` in the body — commit, how fast it came up, uptime, a link to the deploy run, and the deployment's own note and error, each on its own line; Open (or Wake it) below. It is a pull's preview card; the facts and `envActions()` (Redeploy / Stop, writers only) are functions, not markup, so the studio head and its preview rows render the same ones | a box per environment with the same three lines |
203203 | **checks line** | `.checks-line` (`.ok`, `.bad`, `.now`) | — | inside the merge box, in the reviews chip's voice: `✓ Checks passed · deploy abc1234 · a passing deploy is required`. Rendered only where the repository runs as an app or requires checks; a merge box gains _Waiting on checks_ | the same line under the review line |
204 | **run log** | `pre.run-log` | `data-stream` while the run is going | the log as written, wrapped so a phone never scrolls sideways; a script tails the SSE stream and follows the bottom until the reader scrolls up, a `<meta refresh>` does it without one | a scrolling pane that follows the tail |
204 | **run log** | `pre.run-log` | `data-run` while the run is going | the log as written, wrapped so a phone never scrolls sideways; a script tails the SSE stream and follows the bottom until the reader scrolls up, a `<meta refresh>` does it without one | a scrolling pane that follows the tail |
205205 | **assignee card** | `.card` with an `.edit-row` form | — | who is on it, then one select and one button for a writer. People first, the crew last and marked `(agent)`, because assigning an agent is what starts it working and the choice is not the same kind of choice | a picker with people, then agents |
206206 | **inbox** (`asks_page.ts`) | one list above the feed | — | _On you_: what asks you and what is assigned to you, one row each, each with what it waits for (`needsYouSection`), and one count in the top bar. Absent when empty: a card saying nothing is a zero drawn | the same two panes on the dashboard |
207207
docs/STUDIO.md +5 −2
@@ -435,8 +435,11 @@ everything the viewer may see) and works like this:
435435 card whose post is still in flight (`data-busy`), is left alone until
436436 the next event.
437437
438 Run logs and the crew's transcript stream line by line over their own
439 `?follow=1` answers; they are the streamed part of a page, not a region.
438 Run logs (the run page, the app page's tail) ride the page's one `/events`
439 stream: the page asks for its runs with `?run=<id>` and lines arrive as
440 `runlog` frames (`{run, line}`) for viewers `mayReadRunLog` allows — no id, no
441 replay, skipped while the reader is behind; the file is the history. The API's
442 `?follow=1` answer remains for tools.
440443
441444 Signed out, `/` is a stranger's front door in either mode — the studio's
442445 door, never a git pitch (`studioDoor` in `studio/home.ts`, decided in
src/http/sse.ts +45 −2
@@ -21,6 +21,9 @@ import { listEvents, listEventsVisibleTo } from "../core/events.ts";
2121 import { audienceFilter } from "../core/event_audience.ts";
2222 import { canRead, getRepoById } from "../core/repos.ts";
2323 import type { ForgeEvent } from "../core/events.ts";
24 import { getRun } from "../core/runs.ts";
25 import { mayReadRunLog } from "../actions/runs.ts";
26 import { subscribeAllRunLogs } from "../runs/log.ts";
2427
2528 const HEARTBEAT_MS = 25_000;
2629
@@ -200,6 +203,18 @@ export function viewerStream(
200203 seen.set(repoId, ok);
201204 return ok;
202205 };
206 // A run's log is narrower than its repository (writers and crew only,
207 // #1075), so it is asked of `mayReadRunLog`, once per run per connection.
208 const logs = new Map<string, boolean>();
209 const mayRead = (runId: string): boolean => {
210 const known = logs.get(runId);
211 if (known !== undefined) return known;
212 const run = getRun(app.db, runId);
213 const repo = run === undefined ? undefined : getRepoById(app.db, run.repoId);
214 const ok = repo !== undefined && mayReadRunLog(app, viewer, repo);
215 logs.set(runId, ok);
216 return ok;
217 };
203218 const named = (event: ForgeEvent): Record<string, unknown> => {
204219 const repo =
205220 event.repoId === null ? undefined : getRepoById(app.db, event.repoId);
@@ -215,7 +230,19 @@ export function viewerStream(
215230 // admins', a person's own choices are theirs (`core/event_audience.ts`).
216231 const meant = audienceFilter(app.db, viewer);
217232 const after = resumeFrom(request);
218 return eventStream(request, (emit) => {
233 const watched = watchedRuns(request);
234 return eventStream(request, (emit, _close, ready) => {
235 // Log lines for the runs this tab asked about (`?run=<id>`): not events,
236 // so no id and no replay — a late tab reads the file. A reader that is
237 // behind skips lines rather than queueing them. The run's repository is
238 // checked like any event's; the line is already redacted.
239 const controller = new AbortController();
240 if (watched.size > 0)
241 subscribeAllRunLogs((runId, line) => {
242 if (!watched.has(runId) || !ready()) return;
243 if (!mayRead(runId)) return;
244 emit("runlog", { run: runId, line });
245 }, controller.signal);
219246 if (after !== undefined) {
220247 const missed = listEventsVisibleTo(app.db, viewer, {
221248 afterId: after,
@@ -224,11 +251,15 @@ export function viewerStream(
224251 for (const event of missed)
225252 if (meant(event)) emit("forge", named(event), event.id);
226253 }
227 return app.bus.subscribe((event: ForgeEvent) => {
254 const unsubscribe = app.bus.subscribe((event: ForgeEvent) => {
228255 if (event.repoId === null || !visible(event.repoId)) return;
229256 if (!meant(event)) return;
230257 emit("forge", named(event), event.id);
231258 });
259 return () => {
260 controller.abort();
261 unsubscribe();
262 };
232263 });
233264 }
234265
@@ -257,6 +288,18 @@ export function sseStream(
257288 });
258289 }
259290
291 /** At most this many runs per stream; ids are validated, never trusted. */
292 const MAX_WATCHED_RUNS = 8;
293
294 /** The run ids a tab asked for: `?run=<id>`, repeated, well-formed only. */
295 function watchedRuns(request: Request): Set<string> {
296 const ids = new Set<string>();
297 for (const id of new URL(request.url).searchParams.getAll("run"))
298 if (/^[0-9a-z]{8,40}$/i.test(id) && ids.size < MAX_WATCHED_RUNS)
299 ids.add(id);
300 return ids;
301 }
302
260303 /** Where a reconnecting client asks to resume: the last event it heard. */
261304 function resumeFrom(request: Request): string | undefined {
262305 const after =
src/runs/log.ts +26
@@ -31,6 +31,10 @@ export type LogListener = (line: string) => void;
3131
3232 const listeners = new Map<string, Set<LogListener>>();
3333
34 /** Every line of every run, for the one /events stream a viewer holds open. */
35 export type AnyLogListener = (runId: string, line: string) => void;
36 const anyListeners = new Set<AnyLogListener>();
37
3438 /** A line without its newline; a trailing newline is added on write. */
3539 const MAX_LINE = 16 * 1024;
3640
@@ -43,6 +47,13 @@ export function appendRunLog(
4347 const clean = redactHeld(line.replace(/\r?\n/g, " ")).slice(0, MAX_LINE);
4448 mkdirSync(runsRoot(dataDir), { recursive: true });
4549 appendFileSync(runLogPath(dataDir, runId), `${clean}\n`);
50 for (const listener of anyListeners) {
51 try {
52 listener(runId, clean);
53 } catch {
54 // Same as below: a watcher's failure is its own.
55 }
56 }
4657 const watching = listeners.get(runId);
4758 if (watching === undefined) return;
4859 for (const listener of watching) {
@@ -124,5 +135,20 @@ export function subscribeRunLog(
124135 else signal.addEventListener("abort", release, { once: true });
125136 }
126137
138 /** Follow every run's log at once; released by `signal`. */
139 export function subscribeAllRunLogs(
140 listener: AnyLogListener,
141 signal: AbortSignal,
142 ): void {
143 if (signal.aborted) return;
144 anyListeners.add(listener);
145 signal.addEventListener("abort", () => anyListeners.delete(listener), {
146 once: true,
147 });
148 }
149
150 /** How many /events streams follow run logs — a test seam for leaks. */
151 export const anyRunLogListenerCount = (): number => anyListeners.size;
152
127153 /** How many runs currently have a listener set — a test seam for leaks. */
128154 export const runLogListenerCount = (): number => listeners.size;
src/web/client.ts +43 −38
@@ -224,7 +224,9 @@ export const studioRunJs = /* js */ `
224224 (function () {
225225 var log = document.getElementById('run-log');
226226 if (!log) return;
227 var url = log.getAttribute('data-stream');
227 // The run's lines arrive over the page's one /events stream
228 // (liveRegionsJs, as \`forge:runlog\`): this opens no stream of its own.
229 var runId = log.getAttribute('data-run');
228230 var who = log.getAttribute('data-who') || 'agent';
229231 var cap = parseInt(log.getAttribute('data-cap') || '0', 10) || 0;
230232 var pulse = document.getElementById('run-pulse');
@@ -360,27 +362,16 @@ export const studioRunJs = /* js */ `
360362 });
361363 }
362364
363 if (!url || typeof EventSource === 'undefined') return;
364 var source = new EventSource(url);
365 if (!runId) return;
365366 var empty = document.getElementById('run-empty');
366 var seeded = false;
367 source.addEventListener('line', function (event) {
368 if (!seeded) {
369 if (event.lastEventId === '1') {
370 Array.prototype.slice.call(log.querySelectorAll('.ln:not(#run-pulse)')).forEach(function (el) { log.removeChild(el); });
371 }
372 seeded = true;
373 if (empty) empty.hidden = true;
374 }
375 var text = event.data;
376 try { var parsed = JSON.parse(text); if (typeof parsed === 'string') text = parsed; } catch (err) {}
367 document.addEventListener('forge:runlog', function (event) {
368 if (event.detail.run !== runId) return;
369 if (empty) { empty.hidden = true; empty = null; }
370 var text = event.detail.line;
377371 add(draw(text));
378372 if (/^(\\$ |test-shards: |\\(fail\\) |\u2500\u2500 shard )/.test(text)) stepsSoon();
379373 });
380 source.addEventListener('done', function (event) {
381 source.close();
382 var run;
383 try { run = JSON.parse(event.data); } catch (err) { return; }
374 function finished(run) {
384375 paint(run);
385376 if (stepsTimer) { window.clearTimeout(stepsTimer); stepsTimer = 0; }
386377 steps();
@@ -393,6 +384,16 @@ export const studioRunJs = /* js */ `
393384 }
394385 window.clearInterval(clock);
395386 tick();
387 }
388 // The run ending is an event like any other; the finished run itself is
389 // one fetch of the API's run, so this page needs nothing of its own.
390 document.addEventListener('forge:event', function (event) {
391 var e = event.detail;
392 if (e.kind !== 'run.finished' || !e.payload || e.payload.runId !== runId || !window.fetch) return;
393 fetch('/api/v1/repos' + location.pathname, { credentials: 'same-origin', headers: { accept: 'application/json' } })
394 .then(function (r) { return r.ok ? r.json() : Promise.reject(r); })
395 .then(finished)
396 .catch(function () { location.reload(); });
396397 });
397398 })();
398399 `;
@@ -417,9 +418,8 @@ export const studioRunJs = /* js */ `
417418 export const appTailJs = /* js */ `
418419 (function () {
419420 var tail = document.getElementById('app-run-tail');
420 if (!tail || typeof EventSource === 'undefined') return;
421 var url = tail.getAttribute('data-stream');
422 if (!url) return;
421 var runId = tail && tail.getAttribute('data-run');
422 if (!runId) return;
423423 var who = tail.getAttribute('data-who') || 'the crew';
424424 var cap = parseInt(tail.getAttribute('data-cap') || '0', 10) || 0;
425425
@@ -433,23 +433,17 @@ export const appTailJs = /* js */ `
433433 tail.scrollTop = tail.scrollHeight;
434434 }
435435
436 var source = new EventSource(url);
437 var seeded = false;
438 source.addEventListener('line', function (event) {
439 if (!seeded) {
440 if (event.lastEventId === '1') {
441 Array.prototype.slice.call(tail.querySelectorAll('.ln')).forEach(function (el) { tail.removeChild(el); });
442 }
443 seeded = true;
444 }
445 var text = event.data;
446 try { var parsed = JSON.parse(text); if (typeof parsed === 'string') text = parsed; } catch (err) {}
447 add(draw(text));
436 var over = false;
437 document.addEventListener('forge:runlog', function (event) {
438 if (over || event.detail.run !== runId) return;
439 add(draw(event.detail.line));
448440 });
449441 // The run is over: stop appending. The row above settles on its final
450 // word the next time the page's own "Now" region repaints, which the
451 // \`run.finished\` event this very moment triggers.
452 source.addEventListener('done', function () { source.close(); });
442 // word when the page's "Now" region repaints on the same \`run.finished\`.
443 document.addEventListener('forge:event', function (event) {
444 var e = event.detail;
445 if (e.kind === 'run.finished' && e.payload && e.payload.runId === runId) over = true;
446 });
453447 })();
454448 `;
455449
@@ -1937,7 +1931,10 @@ export const boardJs = /* js */ `
19371931 export const liveRegionsJs = /* js */ `
19381932 (function () {
19391933 var regions = document.querySelectorAll('[data-live]');
1940 if (regions.length === 0 || typeof EventSource === 'undefined') return;
1934 // Runs whose log lines this page follows (a run page's log, the app page's
1935 // tail): they ride the same stream, as \`runlog\` frames.
1936 var runs = Array.prototype.map.call(document.querySelectorAll('[data-run]'), function (el) { return el.getAttribute('data-run'); }).filter(Boolean);
1937 if ((regions.length === 0 && runs.length === 0) || typeof EventSource === 'undefined') return;
19411938 function matches(patterns, kind, repo, region) {
19421939 var want = region.getAttribute('data-live-repo');
19431940 if (want && want !== repo) return false;
@@ -2058,13 +2055,21 @@ export const liveRegionsJs = /* js */ `
20582055 function connect() {
20592056 if (retry) { clearTimeout(retry); retry = null; }
20602057 if (source) source.close();
2061 source = since ? new EventSource('/events?since=' + encodeURIComponent(since)) : new EventSource('/events');
2058 var query = (since ? ['since=' + encodeURIComponent(since)] : []).concat(runs.map(function (id) { return 'run=' + encodeURIComponent(id); })).join('&');
2059 source = new EventSource(query ? '/events?' + query : '/events');
20622060 source.addEventListener('open', function () { state('open'); });
20632061 source.addEventListener('error', function () {
20642062 state('reconnecting');
20652063 if (source.readyState === 2 && retry === null) retry = setTimeout(connect, 3000);
20662064 });
20672065 source.addEventListener('forge', onForge);
2066 // Lines are not history: no id, no replay. A tab that missed some reads the file.
2067 source.addEventListener('runlog', function (event) {
2068 var data;
2069 try { data = JSON.parse(event.data); } catch (err) { return; }
2070 if (data && typeof data.run === 'string' && typeof data.line === 'string')
2071 document.dispatchEvent(new CustomEvent('forge:runlog', { detail: data }));
2072 });
20682073 }
20692074 function onForge(event) {
20702075 if (event.lastEventId) since = event.lastEventId;
src/web/studio/log.ts +3 −2
@@ -58,7 +58,8 @@ export function logBox(opts: {
5858 who: string;
5959 cap: number;
6060 lines: readonly string[];
61 stream?: string;
61 /** The run whose lines patch in over the page's one /events stream. */
62 run?: string;
6263 pulse?: boolean;
6364 className?: string;
6465 extra?: Html;
@@ -74,7 +75,7 @@ export function logBox(opts: {
7475 id="${opts.id}"
7576 data-who="${opts.who}"
7677 data-cap="${opts.cap}"
77 ${opts.stream ? html`data-stream="${opts.stream}"` : null}
78 ${opts.run ? html`data-run="${opts.run}"` : null}
7879 >
7980 ${when(
8081 hidden > 0,
src/web/studio/now.ts +1 −1
@@ -179,7 +179,7 @@ export async function nowCard(
179179 activeRun.id,
180180 LOG_TAIL_CAP,
181181 ).lines,
182 stream: `/api/v1/repos/${repo.ownerName}/${repo.name}/runs/${activeRun.id}/log?follow=1`,
182 run: activeRun.id,
183183 className: "log-tail",
184184 })
185185 : undefined;
src/web/studio/previews.ts +2 −3
@@ -230,7 +230,6 @@ function productionTail(
230230 limit: 8,
231231 }).some((r) => r.state === "running");
232232 if (agentBusy) return none;
233 const stream = `/api/v1/repos/${repo.ownerName}/${repo.name}/runs/${production.runId}/log?follow=1`;
234233 if (deploying)
235234 return {
236235 box: logBox({
@@ -239,7 +238,7 @@ function productionTail(
239238 cap: LOG_TAIL_CAP,
240239 lines: readRunLogTail(ctx.app.config.dataDir, production.runId, LOG_TAIL_CAP)
241240 .lines,
242 stream,
241 run: production.runId,
243242 className: "log-tail",
244243 }),
245244 deploying: true,
@@ -262,7 +261,7 @@ function productionTail(
262261 who: "the app",
263262 cap: LOG_TAIL_CAP,
264263 lines,
265 stream,
264 run: production.runId,
266265 className: "log-tail",
267266 }),
268267 deploying: false,
src/web/studio/run.ts +3 −4
@@ -25,7 +25,7 @@ import { getUserById } from "../../core/users.ts";
2525 import { repoDir } from "../../git/repos.ts";
2626 import type { Ctx } from "../../http/context.ts";
2727 import { crumbsFor, repoBase, repoHeader, repoPalette } from "../chrome.ts";
28 import { studioRunJs } from "../client.ts";
28 import { liveRegionsJs, studioRunJs } from "../client.ts";
2929 import { html, raw, when, type Html } from "../html.ts";
3030 import { runLine } from "../describe.ts";
3131 import { page } from "../layout.ts";
@@ -107,7 +107,6 @@ export async function runView(
107107 const all = ctx.url.searchParams.get("all") === "1";
108108 const held = listHeldSecrets(db, run.id);
109109 const carried = carriedBy(db, run.id);
110 const stream = `/api/v1/repos/${repo.ownerName}/${repo.name}/runs/${run.id}/log?follow=1`;
111110
112111 // The pull this run's tell has become, once one exists: the tell itself
113112 // when the run is already a pull's own (feedback, a failed check, a
@@ -308,7 +307,7 @@ export async function runView(
308307 lines,
309308 allHref: `${base}/runs/${run.id}?all=1`,
310309 truncated,
311 ...(unfinished ? { stream } : {}),
310 ...(unfinished ? { run: run.id } : {}),
312311 pulse: run.state === "running",
313312 extra: html`<button type="button" class="run-jump" id="run-jump" hidden>
314313 newer below
@@ -383,7 +382,7 @@ export async function runView(
383382 crumbs: crumbsFor(repo),
384383 palette: repoPalette(ctx, repo),
385384 body,
386 scriptJs: studioRunJs,
385 scriptJs: `${liveRegionsJs}\n${studioRunJs}`,
387386 // The no-script half of a live log: with JavaScript off, the page
388387 // refreshes itself while the run is going (`layout.ts` writes it inside
389388 // `<noscript>`, so a browser running the stream above never reloads).
test/run-log-audience.test.ts +54 −1
@@ -21,7 +21,7 @@ import { addCrew } from "../src/core/agents.ts";
2121 import { createToken } from "../src/core/tokens.ts";
2222 import { createUser, type User } from "../src/core/users.ts";
2323 import { forgeHttp, type ForgeHttp } from "../src/http/server.ts";
24 import { appendRunLog } from "../src/runs/log.ts";
24 import { anyRunLogListenerCount, appendRunLog } from "../src/runs/log.ts";
2525 import { quietLogs } from "./helpers/globals.ts";
2626
2727 quietLogs();
@@ -221,3 +221,56 @@ describe("run log audience", () => {
221221 finishRun(app.db, run.id, { state: "ok", summary: "done" });
222222 });
223223 });
224
225 describe("run log lines on /events", () => {
226 async function frames(who: string | undefined, id: string, emit: () => void) {
227 const res = await http.handle(
228 new Request(`http://forge.test/events?run=${id}`, {
229 headers:
230 who === undefined ? {} : { authorization: `Bearer ${token[who]}` },
231 }),
232 );
233 const reader = res.body!.getReader();
234 await reader.read(); // ": connected"
235 emit();
236 await Bun.sleep(30);
237 const out: string[] = [];
238 const more = reader.read().then((r) => out.push(new TextDecoder().decode(r.value)));
239 await Promise.race([more, Bun.sleep(100)]);
240 await reader.cancel();
241 return out.join("");
242 }
243
244 test("a writer hears a redacted, id-less runlog frame; a stranger hears nothing", async () => {
245 const run = createRun(app.db, {
246 repoId: repoRow.id,
247 kind: "agent",
248 actorId: aliceId,
249 reason: "assigned",
250 });
251 claimRun(app.db, run.id);
252 const say = () =>
253 appendRunLog(dataDir, run.id, "R8LIVE token=ghp_abcdefghijklmnopqrstuvwxyz0123456789");
254 const mine = await frames("alice", run.id, say);
255 expect(mine).toContain("event: runlog");
256 expect(mine).toContain("R8LIVE");
257 expect(mine).not.toContain("ghp_abcdefghijklmnopqrstuvwxyz0123456789");
258 expect(mine).not.toContain("\nid:");
259 for (const who of [undefined, "mallory"])
260 expect(await frames(who, run.id, say)).not.toContain("R8LIVE");
261 // A run the tab did not ask about is not sent, and listeners are released.
262 expect(await frames("alice", "01zzzzzzzzzzzzzzzzzzzzzzzz", say)).not.toContain("R8LIVE");
263 expect(anyRunLogListenerCount()).toBe(0);
264 });
265
266 test("a run page and the app tail open no EventSource beside /events", async () => {
267 const page = await get(`/alice/square/runs/${runId}`, "alice");
268 expect(page.text).not.toContain("log?follow=1");
269 expect(page.text).not.toContain("data-stream");
270 const { studioRunJs, appTailJs, liveRegionsJs } = await import("../src/web/client.ts");
271 for (const js of [studioRunJs, appTailJs])
272 expect(js).not.toContain("new EventSource");
273 expect(liveRegionsJs.match(/new EventSource/g)?.length).toBe(1);
274 expect(liveRegionsJs).toContain("/events?");
275 });
276 });
test/studio-runs.test.ts +5 −5
@@ -936,7 +936,7 @@ describe("the app's page tails the crew's log while it works", () => {
936936 const page = await (await get("/alice/engine", writerCookie)).text();
937937 expect(page).toContain('id="app-run-tail"');
938938 expect(page).toContain(
939 `data-stream="/api/v1/repos/alice/engine/runs/${run.id}/log?follow=1"`,
939 `data-run="${run.id}"`,
940940 );
941941 // Bounded on the first paint too: only the last handful made it, and
942942 // the box says so.
@@ -1132,7 +1132,7 @@ describe("the app's page tails the deploy that is bringing it alive", () => {
11321132 expect(page).toContain('id="app-run-tail"');
11331133 expect(page).toContain('data-who="the deploy"');
11341134 expect(page).toContain(
1135 `data-stream="/api/v1/repos/alice/kindling/runs/${deployRun.id}/log?follow=1"`,
1135 `data-run="${deployRun.id}"`,
11361136 );
11371137 expect(page).toContain("install …");
11381138 // No script, no problem: the page keeps refreshing while the deploy
@@ -1184,7 +1184,7 @@ describe("the app's page tails the deploy that is bringing it alive", () => {
11841184 expect(page.match(/id="app-run-tail"/g)?.length).toBe(1);
11851185 expect(page).not.toContain('data-who="the deploy"');
11861186 expect(page).toContain(
1187 `data-stream="/api/v1/repos/alice/kindling/runs/${agentRun.id}/log?follow=1"`,
1187 `data-run="${agentRun.id}"`,
11881188 );
11891189
11901190 finishRun(app.db, deployRun.id, { state: "ok", summary: "deploy" });
@@ -1350,7 +1350,7 @@ describe("the app's page tails production's own output while it runs (#284)", ()
13501350 expect(page).toContain('id="app-run-tail"');
13511351 expect(page).toContain('data-who="the app"');
13521352 expect(page).toContain(
1353 `data-stream="/api/v1/repos/alice/furnace/runs/${deployRun.id}/log?follow=1"`,
1353 `data-run="${deployRun.id}"`,
13541354 );
13551355 expect(page).not.toContain(">serving request 0<");
13561356 expect(page).toContain(">serving request 8<");
@@ -1389,7 +1389,7 @@ describe("the app's page tails production's own output while it runs (#284)", ()
13891389 expect(page.match(/id="app-run-tail"/g)?.length).toBe(1);
13901390 expect(page).not.toContain('data-who="the app"');
13911391 expect(page).toContain(
1392 `data-stream="/api/v1/repos/alice/furnace/runs/${agentRun.id}/log?follow=1"`,
1392 `data-run="${agentRun.id}"`,
13931393 );
13941394
13951395 finishRun(app.db, agentRun.id, { state: "ok", summary: "planned" });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs