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

The changelog's top line reads "Live: 8a16183" on a build that is not a release, not "Live: dev · 8a16183" #7944

Merged opened this

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

Merged

scout/forge:scout/7939-the-changelog-s-top-line-reads-live-8a16 → main 2 commits fork 2 threads · 2 unresolved

  • Merged. scout/7939-the-changelog-s-top-line-reads-live-8a16 was merged into main as e74b539.

Review

Sign in to review this change.
2 files changed +28 −1
src/web/pages/changelog.ts +4 −1
@@ -115,7 +115,10 @@ export function shippedRegion(read: Landings, choice: string, now: Date = new Da
115115 const onItsWay = read.onItsWay.filter(keep);
116116 const todayIs = dayOf(now.toISOString(), zone);
117117 const today = live.filter((l) => dayOf(l.at, zone) === todayIs).length;
118 const version = read.commit === null ? read.version : html`${read.version} · ${sha(read.commit)}`;
118 const commit = read.commit === null ? null : sha(read.commit);
outdated

Unrequested scope: the commit link (and the read.own branch) changes the release line as well. Use sha(read.commit) as before; the issue only asks to drop "dev".

119 // A build that is not a release has no version worth a reader's attention: the commit says it.
120 const version =
121 read.version !== "dev" ? (commit === null ? read.version : html`${read.version} · ${commit}`) : (commit ?? "a development build");
119122 const top = html`<p class="small muted" id="shipped-top">
120123 Live: ${version}. <span id="shipped-today">${shippedToday(today, zone === "UTC")}</span>
121124 </p>`;
test/changelog.test.ts +24
@@ -331,3 +331,27 @@ describe("the browser regroups the changelog into the reader's days", () => {
331331 await window.happyDOM.close();
332332 });
333333 });
334
335 describe("the top line names what is running", () => {
336 const top = async (version: string, commit: string | null) => {
337 const { shippedRegion } = await import("../src/web/pages/changelog.ts");
338 const read = { live: [], onItsWay: [], version, commit, own: "a/forge" } as any;
339 return String(shippedRegion(read, "all")).match(/id="shipped-top">([\s\S]*?)<span id="shipped-today"/)![1]!;
340 };
341
342 test("a development build with a commit reads the short sha and no dev", async () => {
343 const line = await top("dev", "8a16183d0000000000000000000000000000abcd");
344 expect(line).toContain("8a16183");

Remove this href assertion along with the link. The test still pins the sha and the absence of dev.

345 expect(line).not.toContain("dev");
346 });
347
348 test("a development build with no commit says so", async () => {
349 expect(await top("dev", null)).toContain("Live: a development build.");
350 });
351
352 test("a release keeps version and sha", async () => {
353 const line = await top("1.2.3", "8a16183d0000000000000000000000000000abcd");
354 expect(line).toContain("1.2.3 · ");
355 expect(line).toContain("8a16183");
356 });
357 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs