Watch
0
0
Fork
You've already forked hyperhive
0

swarm: the notification router tells a PR's author when CI on it fails or is cancelled

This commit is contained in:
damocles 2026-11-06 21:25:08 +01:00 • committed by mara
commit c8eaa93268

View file

@ -1892,6 +1892,14 @@ fn hook_registration(kind: DeliveryKind) -> (&'static [&'static str], HookScope<
],
HookScope::Instance,
),
// Instance-wide too: the outcome of a CI run, which the router tells a
// PR's author about. A hook of its own, because Forgejo's hook edit
// never sets `workflow_run_*` events: a hook can only get them when it
// is created.
DeliveryKind::WorkflowRun => (
&["workflow_run_failure", "workflow_run_cancelled"],
HookScope::Instance,
),
}
}
@ -2244,10 +2252,15 @@ mod tests {
"pull_request_review_comment",
]
);
assert_eq!(
events(DeliveryKind::WorkflowRun),
["workflow_run_failure", "workflow_run_cancelled"]
);
// The events a stored flow's source may name are the ones the hooks
// deliver to the router.
let mut routed = events(DeliveryKind::Issues);
routed.extend(events(DeliveryKind::PullRequest));
routed.extend(events(DeliveryKind::WorkflowRun));
routed.sort_unstable();
let mut sources = swarm_wire::notify_flows::SOURCE_EVENTS
.iter()