pr conflicts: bound the forge list and skip branches no pr targets
This commit is contained in:
parent
11eb7dac9c
commit
02f21940a4
1 changed files with 272 additions and 13 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue