Watch
0
0
Fork
You've already forked hyperhive
0

request the review classifier's review when a PR's head moves

The router gets a request_reviewer node and a pull_request_sync source;
the built-in head-classifier flow asks swarm-controller, over
$SWARM.router.sink.request-reviewer, to request review-classifier on
every push, unless its review of the head already stands. The controller
subscribes to pull_request_sync on its pull-request hook and answers
the router; nats-auth grants the router the publish and the controller
the subscribe.
This commit is contained in:
atlas 2026-10-24 14:28:27 +02:00
commit 0b1669a364
20 changed files with 1231 additions and 64 deletions

View file

@ -55,6 +55,7 @@ pub mod legacy_tokens;
pub mod objects;
pub mod operator_profiles;
pub mod pull_diff;
pub mod review_request;
pub mod runner_token;
pub mod site_admin;
@ -1760,12 +1761,12 @@ fn hook_registration(kind: DeliveryKind) -> (&'static [&'static str], HookScope<
// classifier's account access can request its review.
DeliveryKind::ReviewRequest => (&["pull_request_review_request"], HookScope::Instance),
// Instance-wide, for the notification router, which reads the assign
// events. They are named: Forgejo's web form shows assignment as a
// box of its own, so a hook edited there can drop it while keeping
// `issues` or `pull_request`.
// events and a push to a PR's branch. They are named: Forgejo's web
// form shows each as a box of its own, so a hook edited there can drop
// one while keeping `issues` or `pull_request`.
DeliveryKind::Issues => (&["issues", "issue_assign"], HookScope::Instance),
DeliveryKind::PullRequest => (
&["pull_request", "pull_request_assign"],
&["pull_request", "pull_request_assign", "pull_request_sync"],
HookScope::Instance,
),
}
@ -2111,7 +2112,7 @@ mod tests {
assert_eq!(events(DeliveryKind::Issues), ["issues", "issue_assign"]);
assert_eq!(
events(DeliveryKind::PullRequest),
["pull_request", "pull_request_assign"]
["pull_request", "pull_request_assign", "pull_request_sync"]
);
// The events a stored flow's source may name are the ones the hooks
// deliver to the router.