+ {(data.ci.ended_wrong?.completed_with_red_ci ?? 0) > 0 && (
+ <>
+ {plural(data.ci.ended_wrong?.completed_with_red_ci ?? 0, "run")} ended done with its CI still red
+ {data.ci.ended_wrong?.completed_red_runs?.[0] && (
+ <> (newest)>
+ )}
+ .{" "}
+ >
+ )}
+ {(data.ci.ended_wrong?.completed_after_stop ?? 0) > 0 && (
+ <>
+ {plural(data.ci.ended_wrong?.completed_after_stop ?? 0, "run")} ended done after stopping with work left
+ {data.ci.ended_wrong?.completed_after_stop_runs?.[0] && (
+ <> (newest)>
+ )}
+ .{" "}
+ >
+ )}
+ Neither should happen: tell Coderhelm support.
+
+ )}
{!!data.loops_stopped?.total && }
{!!data.waiting?.total && }
diff --git a/dashboard/src/app/runs/detail/page.tsx b/dashboard/src/app/runs/detail/page.tsx
index 42b48110..d1c4065d 100644
--- a/dashboard/src/app/runs/detail/page.tsx
+++ b/dashboard/src/app/runs/detail/page.tsx
@@ -13,7 +13,7 @@ import { Callout } from "@/components/callout";
import { InlineMarkdown, Markdown } from "@/components/markdown";
import { buttonClass, dangerButton, focusRing, fullWidthOnPhone, primaryButton, secondaryButton } from "@/components/ui";
import { Page, PageHeader, SectionHeading } from "@/components/page";
-import { RunStatusBadge, runCanClose, runCloseIsLikely, runIsLive, runStatusLabel } from "@/components/run-status";
+import { RunStatusBadge, runCanClose, runCloseIsLikely, runHeldOn, runIsLive, runStatusLabel } from "@/components/run-status";
import { CloseRunDialog } from "@/components/close-run-dialog";
import { Chip, Time, formatDuration as sharedDuration, formatMs } from "@/components/list";
import { usePaletteActions, type PageAction } from "@/components/command-palette";
@@ -1050,6 +1050,7 @@ function RunDetailInner() {
status={run.status}
draftHold={hold?.kind}
waitingOn={!run.questions?.length && !!run.waiting_on?.action}
+ heldOn={run.status === "needs_input" || hold ? runHeldOn([...(hold?.reasons ?? []).map((r) => r.what), run.status === "needs_input" ? run.waiting_on?.detail : null]) : null}
unfinishedRound={!!run.round_incomplete && ["completed", "success"].includes(run.status)}
/>
}
diff --git a/dashboard/src/components/run-status.tsx b/dashboard/src/components/run-status.tsx
index 918dd9dc..b65e9936 100644
--- a/dashboard/src/components/run-status.tsx
+++ b/dashboard/src/components/run-status.tsx
@@ -77,14 +77,27 @@ const UNFINISHED_ROUND: RunLook = { label: "PR open, fix unfinished", tone: "att
const DRAFT_HELD: RunLook = { label: "PR held", tone: "waiting", group: "waiting" };
/** The same, when GitHub refused every try to mark it ready. */
const DRAFT_NOT_MARKED: RunLook = { label: "PR held", tone: "attention", group: "waiting" };
+/** The pull request is held because its CI fails: named so, never "Done". */
+const CI_FAILING: RunLook = { label: "CI failing", tone: "attention", group: "waiting" };
+/** The run stopped before its planned work was done; its draft says what is left. */
+const STOPPED_UNFINISHED: RunLook = { label: "Stopped, not finished", tone: "attention", group: "waiting" };
/** Waiting on a person for something that isn't a question (`waiting_on`): reviewing the pull request, say. */
const WAITING_ON_YOU: RunLook = { label: "Waiting on you", tone: "waiting", group: "waiting" };
+/** What a run that needs a person is held on, from its hold reasons and its wait: CI failing, or work left unfinished. */
+export function runHeldOn(whats: (string | null | undefined)[]): "ci_failing" | "unfinished" | null {
+ const w = whats.map((s) => (s ?? "").trim());
+ if (w.some((s) => s.startsWith("CI is failing"))) return "ci_failing";
+ if (w.some((s) => s.startsWith("Planned work is not done") || s.startsWith("Stopped:"))) return "unfinished";
+ return null;
+}
+
export function RunStatusBadge({
status,
unfinishedRound,
draftHold,
waitingOn,
+ heldOn,
}: {
status: string | null | undefined;
unfinishedRound?: boolean;
@@ -92,8 +105,14 @@ export function RunStatusBadge({
draftHold?: string | null;
/** A `needs_input` run waits for a named action, not an answer. */
waitingOn?: boolean;
+ /** What holds it, when that is CI failing or unfinished work (`runHeldOn`). */
+ heldOn?: "ci_failing" | "unfinished" | null;
}) {
- const look = draftHold
+ const look = heldOn === "ci_failing"
+ ? CI_FAILING
+ : heldOn === "unfinished"
+ ? STOPPED_UNFINISHED
+ : draftHold
? draftHold === "failed"
? DRAFT_NOT_MARKED
: DRAFT_HELD
diff --git a/dashboard/src/lib/api.ts b/dashboard/src/lib/api.ts
index b9d03770..4b04cbd9 100644
--- a/dashboard/src/lib/api.ts
+++ b/dashboard/src/lib/api.ts
@@ -3801,6 +3801,13 @@ export interface Analytics {
outcomes?: AnalyticsCiOutcomes;
/** Why Coderhelm left a red PR to a person, most common first. */
gave_up_reasons?: { reason: string; count: number }[];
+ /** Runs that ended in a state Coderhelm must never leave (both should be zero). Missing from older backends. */
+ ended_wrong?: {
+ completed_with_red_ci: number;
+ completed_red_runs: string[];
+ completed_after_stop: number;
+ completed_after_stop_runs: string[];
+ };
};
/** Runs the run guard ended for making no progress. Missing from older backends. */
loops_stopped?: { total: number; reasons: { reason: string; count: number }[] };