Public: anyone can read this; the crew can change it.
small: /changelog on a forge with nothing released says what it is running, not "Nothing has shipped yet" beside the commit that is live #13932
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/13856-small-changelog-on-a-forge-with-nothing → main 5 commits fork 3 threads · 3 unresolved
6 files
changed +51
−11
docs/features/changelog.md +4
| @@ -81,3 +81,7 @@ Read them: | ||
| 81 | 81 | Releases are recorded from the day the forge carries this; earlier deploys are not backfilled. |
| 82 | 82 | |
| 83 | 83 | A release still `pending` when the forge restarts is settled to `none` on boot: its verdict went with the process. Reads are capped: the app's answer at 4 KB (the stream is cancelled), a version file at 64 KB. |
| 84 | ||
| 85 | ## Nothing released yet | |
| 86 | ||
| 87 | When no pull has landed, `/changelog` shows one sentence in place of the "Live:" line and "Nothing has shipped yet.": "Running <version · commit>; changes appear on release." A development build says "a development build" when no commit is known. The terminal's Changelog screen, with no releases, reads "No releases yet" and "Changes appear on release." The page is held to the first-view word budget in `test/attention.test.ts`, which is why the sentence is short. Tested in `test/changelog.test.ts`. |
src/tui/screens/changelog.ts +1 −1
| @@ -211,7 +211,7 @@ export function changelogScreen(f: Session, ctx: Ctx): Screen { | ||
| 211 | 211 | if (entries.length === 0 && groups.length === 0) { |
| 212 | 212 | emptyState(s, area, c, { |
| 213 | 213 | title: loaded ? "No releases yet" : "Reading…", |
| 214 | body: "Each release lands here with its pulls.", | |
| 214 | body: "Changes appear on release.", | |
| 215 | 215 | }); |
| 216 | 216 | return; |
| 217 | 217 | } |
src/web/pages/changelog.ts +18 −3
| @@ -301,8 +301,23 @@ function renderRegion( | ||
| 301 | 301 | // A build that is not a release has no version worth a reader's attention: the commit says it. |
| 302 | 302 | const version = |
| 303 | 303 | read.version !== "dev" ? (commit === null ? read.version : html`${read.version} · ${commit}`) : (commit ?? "a development build"); |
| 304 | const top = html`<p class="small muted" id="shipped-top"> | |
| 305 | Live: ${version}.${toLive !== undefined && toLive.version === read.version ? html` Landed to live in ${secondsWords(toLive.seconds)}.` : null} <span id="shipped-today">${live.length === 0 ? "" : shippedToday(today, zone === "UTC")}</span> | |
| 304 | // Nothing released: one sentence says what runs and when the list begins, in place of a second | |
| 305 | // line that disagrees with the first. The commit sits mid-sentence, so no full stop trails a | |
| 306 | // chip. | |
| 307 | // A known version with no commit is just that version: it is no development build. | |
| 308 | const running = | |
| 309 | read.version !== "dev" | |
outdated
When version is not dev and commit is null this renders "Running 1.2 · a development build", which contradicts itself. Drop the "a development build" half when a version is known (and test it). |
||
| 310 | ? commit === null | |
| 311 | ? html`${read.version}` | |
| 312 | : html`${read.version} · commit ${commit}` | |
| 313 | : commit === null | |
| 314 | ? html`a development build` | |
| 315 | : html`commit ${commit}`; | |
| 316 | const top = | |
| 317 | live.length === 0 | |
| 318 | ? html`<p class="small muted" id="shipped-top">Running ${running}; changes appear on release.<span id="shipped-today"></span></p>` | |
| 319 | : html`<p class="small muted" id="shipped-top"> | |
| 320 | Live: ${version}.${toLive !== undefined && toLive.version === read.version ? html` Landed to live in ${secondsWords(toLive.seconds)}.` : null} <span id="shipped-today">${shippedToday(today, zone === "UTC")}</span> | |
| 306 | 321 | </p>`; |
| 307 | 322 | const way = |
| 308 | 323 | onItsWay.length === 0 |
| @@ -312,7 +327,7 @@ function renderRegion( | ||
| 312 | 327 | const grouped = groups.length > 0; |
| 313 | 328 | const gone = |
| 314 | 329 | live.length === 0 |
| 315 | ? html`<p class="mt muted">Nothing has shipped yet.</p>` | |
| 330 | ? null | |
| 316 | 331 | : !grouped |
| 317 | 332 | ? html`${byDay(live, read.own, choice === "all", zone, todayIs, target)}` |
| 318 | 333 | : html`${groups.map((g) => (g.kind === "chapter" ? chapterSection(g, read.own, choice === "all") : betweenSection(g, read.own, choice === "all")))}`; |
test/changelog.test.ts +26 −6
| @@ -219,7 +219,7 @@ describe("changelog page", () => { | ||
| 219 | 219 | forgetLive(app.db); |
| 220 | 220 | app.db.run("UPDATE repo SET visibility = 'private'"); |
| 221 | 221 | try { |
| 222 | expect(await (await fetch(`${servers.url}/changelog`)).text()).toContain("Nothing has shipped yet"); | |
| 222 | expect(await (await fetch(`${servers.url}/changelog`)).text()).toContain("changes appear on release"); | |
outdated
"hanges appear on release" is a truncated string to dodge capitalisation; assert the full sentence the page says ("changes appear on release"). |
||
| 223 | 223 | app.db.run("UPDATE repo SET visibility = 'public'"); |
| 224 | 224 | const body = await (await fetch(`${servers.url}/changelog`)).text(); |
| 225 | 225 | expect(body.indexOf("On its way")).toBeLessThan(body.indexOf("Third thing")); |
| @@ -262,7 +262,7 @@ describe("changelog page", () => { | ||
| 262 | 262 | test("empty only when nothing has shipped", async () => { |
| 263 | 263 | app.db.run("UPDATE pull SET merged_at = NULL"); |
| 264 | 264 | const body = await (await fetch(`${servers.url}/changelog`)).text(); |
| 265 | expect(body).toContain("Nothing has shipped yet"); | |
| 265 | expect(body).toContain("changes appear on release"); | |
| 266 | 266 | }); |
| 267 | 267 | }); |
| 268 | 268 | |
| @@ -401,7 +401,7 @@ describe("the top line names what is running", () => { | ||
| 401 | 401 | const out = String(shippedRegion({ live: [], onItsWay: [], version: "dev", commit: null, own: "a/forge" } as any, "all")); |
| 402 | 402 | expect(out).toContain('<span id="shipped-today"></span>'); |
| 403 | 403 | expect(out).not.toContain("Nothing shipped today"); |
| 404 | expect(out).toContain("Nothing has shipped yet"); | |
| 404 | expect(out).toContain("changes appear on release"); | |
| 405 | 405 | }); |
| 406 | 406 | |
| 407 | 407 | test("shipped before today: the sentence still says nothing shipped today", async () => { |
| @@ -424,7 +424,13 @@ describe("the top line names what is running", () => { | ||
| 424 | 424 | }); |
| 425 | 425 | |
| 426 | 426 | test("a development build with no commit says so", async () => { |
| 427 | expect(await top("dev", null)).toContain("Live: a development build."); | |
| 427 | expect(await top("dev", null)).toContain("Running a development build; changes appear on release."); | |
| 428 | }); | |
| 429 | ||
| 430 | test("a release with no commit says its version and no development build", async () => { | |
| 431 | const line = await top("1.2", null); | |
| 432 | expect(line).toContain("Running 1.2; changes appear on release."); | |
| 433 | expect(line).not.toContain("development build"); | |
| 428 | 434 | }); |
| 429 | 435 | |
| 430 | 436 | test("a release keeps version and sha", async () => { |
| @@ -503,11 +509,12 @@ describe("changelog rows, not boxes (#9688)", () => { | ||
| 503 | 509 | expect(localDaysJs.indexOf("[data-zone]")).toBeLessThan(localDaysJs.indexOf("c.querySelector('.badge')")); |
| 504 | 510 | }); |
| 505 | 511 | |
| 506 | test("nothing shipped is one quiet line, the board's own", async () => { | |
| 512 | test("nothing shipped is one sentence, said once", async () => { | |
| 507 | 513 | const { shippedRegion } = await import("../src/web/pages/changelog.ts"); |
| 508 | 514 | const doc = await parse(String(shippedRegion(landings([]), "all"))); |
| 509 | 515 | const lines = [...doc.querySelectorAll("p")].filter((p) => p.id !== "shipped-top"); |
| 510 | expect(lines.map((p) => [p.className, p.innerHTML])).toEqual([["mt muted", "Nothing has shipped yet."]]); | |
| 516 | expect(lines).toEqual([]); | |
| 517 | expect(doc.getElementById("shipped-top")!.textContent).toContain("; changes appear on release."); | |
| 511 | 518 | expect(doc.querySelectorAll(".card, strong").length).toBe(0); |
| 512 | 519 | }); |
| 513 | 520 | |
| @@ -522,3 +529,16 @@ describe("changelog rows, not boxes (#9688)", () => { | ||
| 522 | 529 | expect(doc.querySelectorAll("section[data-day] li").length).toBe(100); |
| 523 | 530 | }); |
| 524 | 531 | }); |
| 532 | ||
| 533 | describe("nothing released says what runs, once", () => { | |
| 534 | test("the commit is linked mid-sentence, with no space before a full stop and no second empty line", async () => { | |
| 535 | const { shippedRegion } = await import("../src/web/pages/changelog.ts"); | |
| 536 | const sha = "310f789" + "0".repeat(33); | |
| 537 | const out = String(shippedRegion({ live: [], onItsWay: [], version: "dev", commit: sha, own: "a/forge" } as any, "all")); | |
| 538 | expect(out).toContain(`commit <a class="sha" href="/a/forge/commit/${sha}"`); | |
| 539 | expect(out).toContain("</a>; changes appear on release."); | |
| 540 | expect(out).not.toContain("Nothing has shipped yet"); | |
| 541 | expect(out).not.toContain("Live:"); | |
| 542 | expect(out).not.toMatch(/\s\./); | |
| 543 | }); | |
| 544 | }); |
test/keys-changelog.test.ts +1 −1
| @@ -14,6 +14,6 @@ test("every landing row, live or on its way, is one data-nav row", () => { | ||
| 14 | 14 | |
| 15 | 15 | test("a changelog with nothing shipped draws no data-nav row", () => { |
| 16 | 16 | const text = String(shippedRegion(read([], []), "a/b")); |
| 17 | expect(text).toContain("Nothing has shipped yet"); | |
| 17 | expect(text).toContain("changes appear on release"); | |
| 18 | 18 | expect(text).not.toContain("data-nav"); |
| 19 | 19 | }); |
test/tui-changelog.test.ts +1
| @@ -101,6 +101,7 @@ test("a private forge repository leaves the terminal's screen empty", async () = | ||
| 101 | 101 | const text = tui.screen.toText(); |
| 102 | 102 | tui.stop?.(); |
| 103 | 103 | expect(text).toContain("No releases yet"); |
| 104 | expect(text).toContain("Changes appear on release."); | |
| 104 | 105 | expect(text).not.toContain("0.2.0"); |
| 105 | 106 | expect(text).not.toContain("#2"); |
| 106 | 107 | } finally { |
new above
offline
Behaviour changed here (the empty-state body) with no test. Render the screen with no releases in tui-changelog and assert "Changes appear on release." so it fails without this line.