Skip to content

store/runHistory#

filterRunHistory()#

function filterRunHistory(entries, filters): RunHistoryEntry[];

Apply the active filters. Exported so the page and its tests share one definition.

Parameters#

Parameter Type
entries RunHistoryEntry[]
filters RunHistoryFilters

Returns#

RunHistoryEntry[]


parseRunHistoryPayload()#

function parseRunHistoryPayload(payload): RunHistoryEntry[];

Turn the backend's JSON payload into entries, dropping anything unusable.

Deliberately tolerant: a single malformed record written by an older build must not blank the whole page — that would reproduce the very failure this subsystem exists to prevent.

Parameters#

Parameter Type
payload string

Returns#

RunHistoryEntry[]


clearRunHistoryFilters#

const clearRunHistoryFilters: any;

RUN_KINDS#

const RUN_KINDS: readonly ["schedule", "acquisition", "export", "report"];

Durable run history — the renderer half of the job centre.

Lives in its own slice rather than in runtime.ts because it is not runtime state: the entries come from a file the backend keeps per profile (repositories/run_history.py) and survive restarts. runtime.scheduleExecutions is the live view of what is running now; this is the archive of what ran.

The wire payload is a JSON array inside common.StringMessage (the same shape setAuditLogs uses), so parseRunHistoryPayload — not a generated type — is the boundary. That keeps the schema free to grow backend-side without a codegen round-trip, and means every field is validated here rather than assumed.


RUN_OUTCOMES#

const RUN_OUTCOMES: readonly ["success", "failure", "cancelled"];

runHistory#

const runHistory: any;

runHistoryFailed#

const runHistoryFailed: any;

runHistoryRequested#

const runHistoryRequested: any;

setRunHistory#

const setRunHistory: any;

toggleRunKindFilter#

const toggleRunKindFilter: any;

toggleRunOutcomeFilter#

const toggleRunOutcomeFilter: any;

RunHistoryEntry#

Properties#

details#

details: Record<string, unknown>;

durationMs#

durationMs: number;

error#

error: string;

Full error text, never truncated for display — the user must be able to copy it.

failingStep#

failingStep: string;

Id of the step that failed, when the backend could attribute the failure.

id#

id: string;

kind#

kind: "schedule" | "acquisition" | "export" | "report";

label#

label: string;

outcome#

outcome: "success" | "failure" | "cancelled";

project#

project: string;

scheduleId#

scheduleId: string;

startedAt#

startedAt: number;

Unix ms. The backend stores seconds; conversion happens at the parse boundary.


RunHistoryFilters#

Properties#

kinds#

kinds: ("schedule" | "acquisition" | "export" | "report")[];

Empty means "no filter", which is different from "none selected".

outcomes#

outcomes: ("success" | "failure" | "cancelled")[];

RunHistoryState#

Properties#

entries#

entries: RunHistoryEntry[];

error#

error: string | null;

filters#

filters: RunHistoryFilters;

status#

status: RunHistoryStatus;

RunHistoryStatus#

type RunHistoryStatus = "idle" | "loading" | "ready" | "error";

RunKind#

type RunKind = typeof RUN_KINDS[number];

RunOutcome#

type RunOutcome = typeof RUN_OUTCOMES[number];