Watch
0
0
Fork
You've already forked hyperhive
0

request the review classifier when a pr is opened or reopened

This commit is contained in:
atlas 2026-10-28 03:31:38 +01:00 • committed by mara
commit b1a00a3222

View file

@ -212,7 +212,7 @@ mod tests {
r.requests,
[ReviewRequest {
flow: "head-classifier".to_owned(),
node: "request".to_owned(),
node: "request-synchronized".to_owned(),
repo: "o/r".to_owned(),
number: 9,
reviewer: "review-classifier".to_owned(),
@ -222,10 +222,19 @@ mod tests {
assert_eq!(r.next, before);
// The source gates: another PR event requests nothing.
for other in ["pull_request", "pull_request_assign", "issues"] {
for other in ["pull_request_assign", "issues"] {
let r = route(other, &pull, &before, &flows, |_| true);
assert!(r.requests.is_empty(), "{other}");
}
// Opening a PR is one `pull_request` event with action `opened`.
let opened = Delivery {
is_pull: true,
..delivery("opened", &[])
};
let r = route("pull_request", &opened, &before, &flows, |_| false);
assert_eq!(r.requests.len(), 1);
assert_eq!(r.requests[0].node, "request-opened");
assert!(r.actions.is_empty() && r.skipped.is_empty());
// Only a PR can be asked to review.
let issue = delivery("synchronized", &[]);
let r = route("pull_request_sync", &issue, &before, &flows, |_| true);