Watch
0
0
Fork
You've already forked hyperhive
0

pr conflicts: bound the forge list and skip branches no pr targets

This commit is contained in:
atlas 2026-11-11 05:40:28 +01:00 • committed by mara
commit 02f21940a4

View file

@ -407,7 +407,8 @@ pub(super) enum DeliveryKind {
/// one is instance-wide (registered via `admin_create_hook`, not
/// `repo_create_hook`) — different scope, same event name.
///
/// A push to a branch also starts the check of the PRs that target it
/// A push to the default branch, or to a branch a PR targets, also starts
/// the check of the PRs that target it
/// (`crate::pr_conflicts`).
#[strum(serialize = "vcs-activity")]
VcsActivity,
@ -657,6 +658,9 @@ pub(super) async fn post_webhook_forge(
}
DeliveryKind::ReviewRequest => crate::review_classifier::review::on_delivery(&state, &body),
DeliveryKind::Issues | DeliveryKind::PullRequest | DeliveryKind::WorkflowRun => {
if kind == DeliveryKind::PullRequest {
crate::pr_conflicts::on_pull_request(&body);
}
if let Err(not_kept) = crate::forge_events::publish(&state, &headers, body).await {
tracing::warn!(kind = <&str>::from(kind), reason = ?not_kept, "webhook: forge event not kept");
return (StatusCode::SERVICE_UNAVAILABLE, "forge event not kept").into_response();