Public: anyone can read this; the crew can change it.
/status and /api/v1/health name the same running commit #14224
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/14220-status-and-api-v1-health-name-the-same-r → main 1 commit fork
1 file
changed +22
−0
test/status-page.test.ts +22
| @@ -177,6 +177,28 @@ describe("GET /status", () => { | ||
| 177 | 177 | expect(Object.keys(j.rows)).toHaveLength(3); |
| 178 | 178 | }); |
| 179 | 179 | |
| 180 | // One answer to "what is running" (#14220): an owner compares the two to tell whether | |
| 181 | // production caught up with main, so they read the same stamp, field for field. | |
| 182 | test("JSON names the same running commit and release as /api/v1/health", async () => { | |
| 183 | const was = { commit: process.env["FORGE_COMMIT"], version: process.env["FORGE_VERSION"] }; | |
| 184 | const commit = "0123456789abcdef0123456789abcdef01234567"; | |
| 185 | process.env["FORGE_COMMIT"] = commit; | |
| 186 | process.env["FORGE_VERSION"] = "v9.8.7"; | |
| 187 | try { | |
| 188 | const s = (await (await fetch(`${base}/status`, { headers: { accept: "application/json" } })).json()) as Record<string, unknown>; | |
| 189 | const h = (await (await fetch(`${base}/api/v1/health`)).json()) as Record<string, unknown>; | |
| 190 | expect(s["commit"]).toBe(commit); | |
| 191 | expect(h["commit"]).toBe(commit); | |
| 192 | expect(s["short"]).toBe("0123456"); | |
| 193 | expect(s["version"]).toBe("9.8.7"); | |
| 194 | expect(h["release"]).toBe(s["version"]); | |
| 195 | } finally { | |
| 196 | for (const [k, v] of [["FORGE_COMMIT", was.commit], ["FORGE_VERSION", was.version]] as const) | |
| 197 | if (v === undefined) delete process.env[k]; | |
| 198 | else process.env[k] = v; | |
| 199 | } | |
| 200 | }); | |
| 201 | ||
| 180 | 202 | test("the footer links to it, beside Privacy", async () => { |
| 181 | 203 | const home = await (await fetch(`${base}/pricing`)).text(); |
| 182 | 204 | expect(home).toMatch(/<a href="\/status">Status<\/a>\s*<a href="\/privacy">Privacy<\/a>/); |
new above
offline