swarm: the notification router tells a PR's author when CI on it fails or is cancelled
This commit is contained in:
parent
d4e58f8741
commit
c8eaa93268
1 changed files with 490 additions and 60 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue