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

/status and /api/v1/health name the same running commit #14224

Merged opened this

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

Merged

scout/forge:scout/14220-status-and-api-v1-health-name-the-same-r → main 1 commit fork

  • Merged. scout/14220-status-and-api-v1-health-name-the-same-r was merged into main as cba9ab0.

Review

Sign in to review this change.
1 file changed +22 −0
test/status-page.test.ts +22
@@ -177,6 +177,28 @@ describe("GET /status", () => {
177177 expect(Object.keys(j.rows)).toHaveLength(3);
178178 });
179179
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
180202 test("the footer links to it, beside Privacy", async () => {
181203 const home = await (await fetch(`${base}/pricing`)).text();
182204 expect(home).toMatch(/<a href="\/status">Status<\/a>\s*<a href="\/privacy">Privacy<\/a>/);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs