feat(taskstate): count completed runs in the per-workflow stats
The transition table moved the no-change outcomes to StatusCompleted, so a run that opens no pull request now ends in a status the per-workflow stats did not count at all: it was not merged, not in review, not parked, and the workflows page would have shown it as a run that went nowhere. The count travels the whole State Store path, since every dashboard consumer reads it through the gRPC client rather than the local store. - WorkflowStats filters `completed` beside merged and pr_open; the SQL is the count, so a wrong filter reads as zero rather than failing, and TestWorkflowStatsCountsCompletedRuns holds it against a real store. - storecontract.WorkflowStat gains Completed (json "completed"), the proto message gains field 9, and workflowStatProto/workflowStatValue carry it; TestWorkflowStatProtoCarriesEveryField round-trips every field by name. - The gateway's chat task report names the status. - The dashboard counts a completed run as delivered in GatePulseCard's totals and badge numerator, and the WorkflowStat/WorkflowStats/WorkflowRow interfaces carry the field. - TestOutcomeSitesAreTransitionsFromRunning is the guard that keeps the producer and the table agreeing: it re-reads this package's tc.Outcome assignment sites from source and requires each status to be one internal/taskstate allows from running, so a new or moved site has to be adjudicated against the table instead of discovered on a live run.
This commit is contained in:
14 files changed
+279
-10
No files matched your search
@@ -14,6 +14,7 @@ export interface WorkflowStats {
|
||||
workflow: string;
|
||||
runs?: number;
|
||||
merged?: number;
|
||||
completed?: number;
|
||||
avg_tokens?: number;
|
||||
avg_steps?: number;
|
||||
origin?: string;
|
||||
@@ -34,6 +35,7 @@ export interface WorkflowRow {
|
||||
workflow: string;
|
||||
runs?: number;
|
||||
merged?: number;
|
||||
completed?: number;
|
||||
avg_tokens?: number;
|
||||
avg_steps?: number;
|
||||
origin?: string;
|
||||
@@ -59,6 +61,7 @@ export function workflowRows(
|
||||
workflow: definition.id,
|
||||
runs: 0,
|
||||
merged: 0,
|
||||
completed: 0,
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user