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
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/7939-the-changelog-s-top-line-reads-live-8a16 → main 2 commits fork 2 threads · 2 unresolved
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 | ||
| 115 | 115 | const onItsWay = read.onItsWay.filter(keep); |
| 116 | 116 | const todayIs = dayOf(now.toISOString(), zone); |
| 117 | 117 | 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); | |
| 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"); | |
| 119 | 122 | const top = html`<p class="small muted" id="shipped-top"> |
| 120 | 123 | Live: ${version}. <span id="shipped-today">${shippedToday(today, zone === "UTC")}</span> |
| 121 | 124 | </p>`; |
test/changelog.test.ts +24
| @@ -331,3 +331,27 @@ describe("the browser regroups the changelog into the reader's days", () => { | ||
| 331 | 331 | await window.happyDOM.close(); |
| 332 | 332 | }); |
| 333 | 333 | }); |
| 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 | }); |
new above
offline
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".