diff --git a/.gitmodules b/.gitmodules index 27c0cee..f624242 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "vendor/sluiceway"] path = vendor/sluiceway url = https://github.com/sluiceway/sluiceway.git - branch = v0.47.0 + branch = v0.48.0 diff --git a/src/components/CountsLine.astro b/src/components/CountsLine.astro index f7c0705..ee2145a 100644 --- a/src/components/CountsLine.astro +++ b/src/components/CountsLine.astro @@ -1,23 +1,33 @@ --- -// CountsLine: the dashboard's counts, in the dashboard's own order. A zero keeps its pill. +// CountsLine: the dashboard's counts, in the dashboard's own order. A zero keeps its pill, +// except busy, which the dashboard shows only when a stack is busy, with the white dot of a +// zero (record 0117). interface Props { - counts: { pending?: number; deploying?: number; failed?: number; "in-sync"?: number }; + counts: { + pending?: number; + deploying?: number; + failed?: number; + "in-sync"?: number; + busy?: number; + }; } -const ORDER = ["pending", "deploying", "failed", "in-sync"] as const; +const ORDER = ["pending", "deploying", "failed", "in-sync", "busy"] as const; const WORD = { pending: "pending", deploying: "deploying", failed: "preview failed", "in-sync": "in sync", + busy: "busy", } as const; const { counts } = Astro.props; +const shown = ORDER.filter((k) => k !== "busy" || (counts.busy ?? 0) > 0); ---
{ - ORDER.map((k) => { + shown.map((k) => { const n = counts[k] ?? 0; return ( diff --git a/src/content/docs/style-check.mdx b/src/content/docs/style-check.mdx index 513a6bd..f69ebb1 100644 --- a/src/content/docs/style-check.mdx +++ b/src/content/docs/style-check.mdx @@ -34,7 +34,7 @@ picture it belongs to. ## Counts line - + A stack id is written whole, as in `apps/web:prod`, and never wraps. diff --git a/src/content/docs/the-header.mdx b/src/content/docs/the-header.mdx index 2441845..e0fbee5 100644 --- a/src/content/docs/the-header.mdx +++ b/src/content/docs/the-header.mdx @@ -43,11 +43,11 @@ export const pictures = [ }, { picture: "failing-0", - alt: "Something failed: the gate is stuck half open over a log, with a red lamp", + alt: "A preview or a deploy failed: the gate is stuck half open over a log, with a red lamp", }, { picture: "failing-4", - alt: "Something failed, 4 stacks are pending: four crates wait behind the gate, which is stuck half open over a log", + alt: "A preview or a deploy failed, 4 stacks are pending: four crates wait behind the gate, which is stuck half open over a log", }, ]; @@ -58,7 +58,9 @@ export const states = headerStates(pictures.map(({ picture }) => picture)); one of {states.count} states.

-When more than one state applies, the first wins, in this order: {states.order}. +When more than one state applies, the first wins, in this order: {states.order}. A +busy stack, one whose lock another update held when the +scan ran, makes no header failing: nothing is wrong with it, and the next scan previews it. Upstream is on the left, where crates pile up while changes are pending. Downstream is on the right, where the water runs while a stack deploys. The pending, queued, deploying and failing @@ -95,11 +97,21 @@ The signs do not move, and nothing else in the picture changes. }, { picture: "failing-4-deletes-replaces", - alt: "Something failed, 4 stacks are pending, some changes delete or replace resources: the gate is stuck over a log and both signs stand in the water", + alt: "A preview or a deploy failed, 4 stacks are pending, some changes delete or replace resources: the gate is stuck over a log and both signs stand in the water", }, ]} /> +## The alt text says it in words + +Where the picture does not load, and in a screen reader, the header is its alt text. It names +the state and the pending count, `Sluiceway: 4 stacks are pending`, and a sign adds its fact, +`, some changes delete or replace resources`. A failing header names what failed and how many, +in the numbers of the counts line under it: `Sluiceway: 1 preview failed`, +`Sluiceway: 2 previews and 1 deploy failed`. The picture is the same jam for any number, so its +own label stays `Sluiceway: something failed`. No picture shows a busy stack, so the alt text +names it last: `, 1 stack is busy`. + ## The water rises in five steps Behind the closed or jammed gate the water rises in five steps, with one amber mark each on the diff --git a/src/content/docs/what-it-looks-like.mdx b/src/content/docs/what-it-looks-like.mdx index 3164e2f..b37e8ad 100644 --- a/src/content/docs/what-it-looks-like.mdx +++ b/src/content/docs/what-it-looks-like.mdx @@ -21,8 +21,9 @@ export const intro = readmeDashboardIntro(); downstream because two stacks deploy, and both signs: a pending row deletes resources and another replaces one. The header shows every picture. - **The counts line.** How many stacks are pending, drifted, deploying, preview failed and in - sync, each behind its count dot, and how many pending stacks - delete or replace resources. Under it, the + sync, each behind its count dot, how many pending stacks + delete or replace resources, and, only when there is one, how many stacks are + busy. Under it, the scan line says which commit the last scan checked out, when, in which run, and when the last full scan was. While a scan runs, a scan-running line under it says since when and links the run, which this example does not show. @@ -66,6 +67,13 @@ export const intro = readmeDashboardIntro(); box deploys them, as a tick on each row. Each stack is judged by its own tick rule and gets its own fresh preview. If a row changes before anyone ticks the confirm box, the confirm box goes and the bulk box comes back. +- **Preview failed and Busy.** A stack whose preview failed twice in one scan, after its + second try, sits under Preview failed. Its row has no + box, says why, and links the run whose job log holds the tool's own words. A + busy stack, one whose lock another update held on both + tries, sits under Busy. Its row starts with `busy:`, names the reason, + `another update holds the stack's lock`, and says that the next scan previews it. Nothing is + wrong with it, and the header does not turn failing. This example shows neither section. - **In sync.** The stacks with nothing to deploy, folded under their count, and under them the stacks left out by ignore, each with its reason. - **Recently deployed, the trail.** Every deploy that ended, newest first, one line each: its diff --git a/src/lib/pages.ts b/src/lib/pages.ts index 577214a..b9db026 100644 --- a/src/lib/pages.ts +++ b/src/lib/pages.ts @@ -375,7 +375,7 @@ export const RECORD_PICTURES: Record = { // The header states, and bad news wins: the state that wins over all the others. "0031": { picture: "failing-0", - alt: "Something failed: the gate is stuck half open over a log, with a red lamp", + alt: "A preview or a deploy failed: the gate is stuck half open over a log, with a red lamp", }, // The files named by role: the first of them, the scan that found nothing yet. "0033": { @@ -418,7 +418,7 @@ export const RECORD_PICTURES: Record = { // nine pending stacks and one failed preview showed two crates behind the jam. "0066": { picture: "failing-9", - alt: "Something failed, 9 stacks are pending: nine crates wait behind the gate, which is stuck half open over a log", + alt: "1 preview failed, 9 stacks are pending: nine crates wait behind the gate, which is stuck half open over a log", }, // A delete sign next to the replace sign, up to 20 crates, and the queued state: all three. "0075": { @@ -431,6 +431,13 @@ export const RECORD_PICTURES: Record = { picture: "queued-0", alt: "Queued behind dependencies: a ticked crate is tied up at the closed gate", }, + // The failing header's alt text names what failed and how many. The dashboard the record + // came from had one failed preview, nothing pending and every other stack in sync: the jam + // with no crate behind it. + "0118": { + picture: "failing-0", + alt: "1 preview failed: the gate is stuck half open over a log, with a red lamp", + }, }; export function recordId(record: Pick): string { diff --git a/test/walk-through.test.ts b/test/walk-through.test.ts index 12d502b..966ab0c 100644 --- a/test/walk-through.test.ts +++ b/test/walk-through.test.ts @@ -56,8 +56,21 @@ describe("the walk-through", () => { expect(walk).toContain('reference/glossary/#failure-line"'); }); + test("says what a busy stack's row reads, as the dashboard writes it", () => { + expect(walk).toMatch(/]*>busy:<\/code>/); + expect(walk).toMatch(/]*>another update holds the stack(?:'|'|’)s lock<\/code>/); + expect(walk).toContain('reference/glossary/#busy-stack"'); + }); + test("names the lines the example does not draw, linked to the glossary", () => { - for (const term of ["scan-running-line", "cost-line", "policy", "preview-failure"]) { + for (const term of [ + "scan-running-line", + "cost-line", + "policy", + "preview-failure", + "second-try", + "busy-stack", + ]) { expect(walk).toContain(`reference/glossary/#${term}"`); } }); diff --git a/vendor/sluiceway b/vendor/sluiceway index 088bd49..3cf5a53 160000 --- a/vendor/sluiceway +++ b/vendor/sluiceway @@ -1 +1 @@ -Subproject commit 088bd497c52d3e65b9e5478d3394206cff2c4e0e +Subproject commit 3cf5a5311f146e55a6f3863ef56ded88afc401eb