From 409711cd7b9e43854ff0fb91ce6b60baeb2f8dc9 Mon Sep 17 00:00:00 2001 From: Dimitris Karvounis <1+jimkarvo@jksoftware.gr> Date: Thu, 3 Sep 2026 13:15:17 +0000 Subject: [PATCH] fix: don't filter actor for review_requested to allow CI self-request (fixes PR 185) --- internal/event/processor.go | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/internal/event/processor.go b/internal/event/processor.go index 7665000..aa13119 100644 --- a/internal/event/processor.go +++ b/internal/event/processor.go @@ -175,14 +175,18 @@ func (p *Processor) HandlePullRequest(e *webhook.PullRequestEvent) { } } - // Remove the actor from notifications (don't notify yourself) - beforeFilter := len(usersToNotify) - usersToNotify = p.filterOutActor(usersToNotify, event.Actor) - p.logger.Debug(). - Int("before_filter", beforeFilter). - Int("after_filter", len(usersToNotify)). - Str("actor_filtered", event.Actor.GiteaUsername). - Msg("filtered out actor from notifications") + // Remove the actor from notifications (don't notify yourself) - but SKIP for review_requested because CI automation may request as same user + if e.Action == "review_requested" { + p.logger.Debug().Str("actor", event.Actor.GiteaUsername).Msg("skipping actor filter for review_requested (CI automation)") + } else { + beforeFilter := len(usersToNotify) + usersToNotify = p.filterOutActor(usersToNotify, event.Actor) + p.logger.Debug(). + Int("before_filter", beforeFilter). + Int("after_filter", len(usersToNotify)). + Str("actor_filtered", event.Actor.GiteaUsername). + Msg("filtered out actor from notifications") + } // Send notifications p.sendNotifications(ctx, event, usersToNotify) @@ -402,10 +406,10 @@ func (p *Processor) sendNotifications(ctx context.Context, event *Event, users [ // filterOutActor removes the event actor from the notification list func (p *Processor) filterOutActor(users []struct { user User - reason NotificationReason + reason NotificationReasol }, actor User) []struct { user User - reason NotificationReason + reason NotificationReasol } { var filtered []struct { user User