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

Main green again: the pull folds' empty review state uses the shared words; capture expects the error page #16714

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

main-red → main 0 commits

  • Merged. main-red was merged into main as aa51435.

Review

Sign in to review this change.
3 files changed +22 −10
src/core/empty_words.ts +1
@@ -58,6 +58,7 @@ const TABLE = {
5858 commits: { sentence: "No commits yet.", reason: "Push a branch and its history shows up here." },
5959 issues: { sentence: "No issues yet." },
6060 pulls: { sentence: "No pulls yet." },
61 reviews: { sentence: "No review yet." },
6162 branches: { sentence: "No branches yet." },
6263 labels: { sentence: "No labels yet." },
6364 events: { sentence: "No events yet." },
src/web/studio/pull_folds.ts +2 −1
@@ -5,6 +5,7 @@
55 */
66 import type { Commit } from "../../git/read.ts";
77 import type { Review } from "../../core/reviews.ts";
8 import { emptyLine } from "../empty_words.ts";
89 import { html, type Html } from "../html.ts";
910 import { icon, row, rowList, sha, time } from "../ui.ts";
1011
@@ -46,7 +47,7 @@ export function pullFolds(i: PullFolds): Html {
4647 "Reviews",
4748 reviewsSummary(i.reviews),
4849 false,
49 i.reviewNodes.length === 0 ? html`<p class="muted small">No review yet.</p>` : html`<div class="timeline">${[...i.reviewNodes]}</div>`,
50 i.reviewNodes.length === 0 ? emptyLine("reviews") : html`<div class="timeline">${[...i.reviewNodes]}</div>`,
5051 );
5152 const log =
5253 i.log === undefined
test/capture-chromium.looks.test.ts +19 −9
@@ -28,32 +28,42 @@ describe.skipIf(chromium === undefined)("a real capture", () => {
2828 test(
2929 "a capture that ends on the browser's error page fails with its reason and writes no picture",
3030 async () => {
31 // `/` bounces to the address the query names; anything else is a page.
3132 const page: ReturnType<typeof Bun.serve> = Bun.serve({
3233 port: 0,
3334 hostname: "127.0.0.1",
34 // Off the app's host, on a name that resolves to loopback without DNS.
35 fetch: (request): Response =>
36 new URL(request.url).pathname === "/"
35 fetch: (request): Response => {
36 const url = new URL(request.url);
37 return url.pathname === "/"
3738 ? new Response(null, {
3839 status: 302,
39 headers: { location: `http://localhost:${page.port}/landed` },
40 headers: { location: `http://${url.searchParams.get("to")}:${page.port}/landed` },
4041 })
4142 : new Response("<!doctype html><p>elsewhere</p>", {
4243 headers: { "content-type": "text/html" },
43 }),
44 });
45 },
4446 });
45 try {
46 const out = join(dataDir, "refused.png");
47 const refused = async (from: string, to: string): Promise<string> => {
48 const out = join(dataDir, `refused-${to}.png`);
4749 const taken = await takeLook({
48 url: `http://127.0.0.1:${page.port}/`,
50 url: `http://${from}:${page.port}/?to=${to}`,
4951 out,
5052 width: 390,
5153 height: 844,
5254 timeoutMs: 30_000,
5355 });
54 expect(JSON.stringify(taken)).toContain("left the app's host for localhost");
5556 // The guard throws before the screenshot: no picture was written.
5657 expect(existsSync(out)).toBe(false);
58 return JSON.stringify(taken);
59 };
60 try {
61 // A bounce to any name but the app's resolves nowhere (#16687): the browser's error page.
62 expect(await refused("127.0.0.1", "localhost")).toContain(
63 "ERR_NAME_NOT_RESOLVED: the browser showed an error page instead of the app",
64 );
65 // A bounce to an address that needs no name lands, on another host: the host check refuses it.
66 expect(await refused("localhost", "127.0.0.1")).toContain("left the app's host for 127.0.0.1");
5767 } finally {
5868 page.stop(true);
5969 }

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs