Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions plugins/stewards/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -1511,10 +1511,11 @@ project steward footer row is the grey ring.
else `on hold`; `stuck` for an open stuck escalation; `N worker(s) running`
counting only workers whose worker-table status is `running` (a busy steward or
reviewer with no running worker falls through, rather than reading `0 workers
running`); `waiting on <nextAction>` when the status actor is `other` (an
external wait is not a block, so its colour follows the glyph); the newest
deployment watch's state (`deploying`, `deployed`, `deploy failed`); the status
`nextAction`; otherwise `no report yet`. The phrase's colour follows the
running`); the newest deployment watch's state (`deploying`, `deployed`,
`deploy failed`), ahead of the free-text `nextAction` whatever the actor (BB-86);
the status `nextAction` verbatim, with `the other party` standing in for an
`other` actor that has no report (an external wait is not a block, so its colour
follows the glyph); otherwise `no report yet`. The phrase's colour follows the
glyph's. `sidebar.ts` derives `state`, `section`
and `phrase` as pure functions and sorts by the section rules; `sidebar.test.ts`
covers every rule and the precedence.
Expand Down
4 changes: 3 additions & 1 deletion plugins/stewards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ switchable from where you are.
**The row and the glyphs (BB-76).** An effort row is two lines: the glyph, the
entity key in bold and the title on line one; the kind (`ticket`, `pull
request`, `review`, `ops`), the entity's phase when it has one, and the status
phrase on line two. A row that needs you adds its prompt and one-click actions
phrase on line two (first match wins: `needs you`, `blocked on …`, a hold,
`stuck`, `N worker(s) running`, the deployment state, then the report's
`nextAction` verbatim). A row that needs you adds its prompt and one-click actions
under line two, in the same row. The glyph is one of four, in precedence order
`you › blocked › running › quiet`: a solid yellow dot when it waits on you, an
empty red ring when blocked, a blue ring that pulses slowly while a worker or
Expand Down
4 changes: 2 additions & 2 deletions plugins/stewards/sidebar-app.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ describe("the stewards sidebar sections, glyphs and phrases (BB-76)", () => {
expect(inflight.textContent).toContain("Waiting ticket");
expect(inflight.textContent).not.toContain("Needs you");
expect(glyphOf(slot, "Waiting ticket")).toBe("quiet");
expect(lineTwo(slot, "Waiting ticket")).toBe("ticket · waiting on an author push");
expect(lineTwo(slot, "Waiting ticket")).toBe("ticket · an author push");
// Monitors holds the ops wait, grey, once opened.
fireEvent.click(slot.getByRole("button", { name: /Monitors/u }));
await waitFor(() => expect(slot.getByText("Ops watch: acme/web")).toBeTruthy());
Expand All @@ -518,7 +518,7 @@ describe("the stewards sidebar sections, glyphs and phrases (BB-76)", () => {
const monitors = slot.getByRole("button", { name: /Monitors/u }).closest("section")!;
expect(monitors.textContent).toContain("Ops watch: acme/web");
expect(glyphOf(slot, "Ops watch: acme/web")).toBe("quiet");
expect(lineTwo(slot, "Ops watch: acme/web")).toBe("ops · waiting on Next scheduled look");
expect(lineTwo(slot, "Ops watch: acme/web")).toBe("ops · Next scheduled look");
const threads = slot.getByRole("button", { name: /Threads/u }).closest("section")!;
expect(threads.textContent).toContain("One-off");
slot.lifecycle.unmount();
Expand Down
23 changes: 13 additions & 10 deletions plugins/stewards/sidebar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,15 @@ describe("stewards sidebar grouping", () => {
// ops + other is a monitor, grey, with the wait phrase.
expect(tab.monitors.map((e) => e.key)).toEqual(["acme/deps"]);
expect(tab.monitors[0]!.state).toBe("quiet");
expect(tab.monitors[0]!.phrase).toBe("waiting on Next scheduled look");
expect(tab.monitors[0]!.phrase).toBe("Next scheduled look");
// ops with blockedOn or needsUser is still blocked, out of monitors.
expect(tab.blocked.map((e) => e.key).sort()).toEqual(["acme/ns", "acme/sentry"]);
// ticket + other is in flight, grey, with the wait phrase; review + other
// with a running worker is blue and reads the count.
expect(tab.efforts.map((e) => e.key).sort()).toEqual(["ENG-1", "acme/web#728"]);
const ticketWait = tab.efforts.find((e) => e.key === "ENG-1")!;
expect(ticketWait.state).toBe("quiet");
expect(ticketWait.phrase).toBe("waiting on an author push");
expect(ticketWait.phrase).toBe("an author push");
const reviewWait = tab.efforts.find((e) => e.key === "acme/web#728")!;
expect(reviewWait.state).toBe("running");
expect(reviewWait.phrase).toBe("1 worker running");
Expand Down Expand Up @@ -342,23 +342,26 @@ describe("stewards sidebar state, section and phrase (BB-76)", () => {
expect(effortPhrase(effort({ key: "d", hold: "a freeze" }))).toBe("on hold");
// 4. stuck
expect(effortPhrase(effort({ key: "e", stuck: true }))).toBe("stuck");
// 5. running workers, before the external wait so a waiting effort with a
// running worker reads the count (BB-81).
// 5. running workers, before the deployment watch and the free-text
// nextAction, so a waiting effort with a running worker reads the count (BB-81).
expect(effortPhrase(effort({ key: "g", runningWorkers: 2 }))).toBe("2 workers running");
expect(effortPhrase(effort({ key: "h", runningWorkers: 1 }))).toBe("1 worker running");
// A busy steward or reviewer with no running worker falls through, not "0 workers running".
expect(effortPhrase(effort({ key: "g2", busy: true, statusNextAction: "a reviewer is checking" }))).toBe("a reviewer is checking");
expect(effortPhrase(effort({ key: "g3", busy: true }))).toBe("no report yet");
// 6. actor = other, after the count
expect(effortPhrase(effort({ key: "f", statusActor: "other", statusNextAction: "an owner LGTM" }))).toBe("waiting on an owner LGTM");
expect(effortPhrase(effort({ key: "f2", statusActor: "other", statusNextAction: "the vendor", runningWorkers: 1 }))).toBe("1 worker running");
// 7. deployment
// 6. deployment, ahead of the free-text nextAction whatever the actor (BB-86).
expect(effortPhrase(effort({ key: "i", deployment: "merged" }))).toBe("deploying");
expect(effortPhrase(effort({ key: "j", deployment: "deployed" }))).toBe("deployed");
expect(effortPhrase(effort({ key: "k", deployment: "failed" }))).toBe("deploy failed");
// 8. nextAction
expect(effortPhrase(effort({ key: "i2", statusActor: "other", deployment: "merged", statusNextAction: "Wait for a bb-server build" }))).toBe("deploying");
expect(effortPhrase(effort({ key: "i3", statusActor: "other", runningWorkers: 1, deployment: "merged" }))).toBe("1 worker running");
// 7. nextAction, verbatim for every actor (BB-86): the external wait is not a prefix.
expect(effortPhrase(effort({ key: "l", statusNextAction: "wait for the review" }))).toBe("wait for the review");
// 9. no report
expect(effortPhrase(effort({ key: "f", statusActor: "other", statusNextAction: "an owner LGTM" }))).toBe("an owner LGTM");
expect(effortPhrase(effort({ key: "f2", statusActor: "other", statusNextAction: "Wait for the hold to lift." }))).toBe("Wait for the hold to lift.");
expect(effortPhrase(effort({ key: "f3", statusActor: "other", statusNextAction: "the vendor", runningWorkers: 1 }))).toBe("1 worker running");
// 8. no report: `the other party` stands in for an external wait with no nextAction.
expect(effortPhrase(effort({ key: "n", statusActor: "other" }))).toBe("the other party");
expect(effortPhrase(effort({ key: "m" }))).toBe("no report yet");
});

Expand Down
9 changes: 6 additions & 3 deletions plugins/stewards/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,11 @@ export function deploymentPhrase(state: DeployState): string {
}

/**
* Line two's status phrase, first match wins (BB-76):
* needs you › blockedOn › hold › stuck › running › actor=other › deployment › nextAction › no report.
* Line two's status phrase, first match wins (BB-76, BB-86):
* needs you › blockedOn › hold › stuck › running › deployment › nextAction › no report.
* An external wait is not a prefix: an `other` actor reads its `nextAction`
* verbatim like any other actor, and `the other party` only stands in when
* there is no report at all.
*/
export function effortPhrase(e: EffortStatus): string {
if (e.needsUser) return "needs you";
Expand All @@ -225,9 +228,9 @@ export function effortPhrase(e: EffortStatus): string {
const n = e.runningWorkers;
return `${n} worker${n === 1 ? "" : "s"} running`;
}
if (e.statusActor === "other") return `waiting on ${e.statusNextAction ?? "the other party"}`;
if (e.deployment !== null) return deploymentPhrase(e.deployment);
if (e.statusNextAction !== null) return e.statusNextAction;
if (e.statusActor === "other") return "the other party";
return "no report yet";
}

Expand Down
Loading