Skip to content

Conversation

@hjk1996
Copy link

@hjk1996 hjk1996 commented Nov 22, 2025

what

  • Added event-aware webhook wiring to support both plan and apply (typed Event + ConfiguredSender, event set on payload, filtered dispatch).
  • Updated project runner to send plan/apply webhooks with the correct event and adjusted Slack attachment text to use the event name.
  • Extended webhook tests to cover plan configs and event filtering.

why

To deliver plan results through the webhook pipeline, and to make webhook payloads/messages clearly identify which event triggered them.

tests

  • Added webhook tests for plan config and event filtering
  • Ran locally: go test ./server/events/webhooks (passes)

references

@dosubot dosubot bot added feature New functionality/enhancement go Pull requests that update Go code labels Nov 22, 2025
@hjk1996 hjk1996 force-pushed the add-plan-webhook-support branch from 6b9da0f to 4a49034 Compare November 22, 2025 09:43

if err != nil {
return "", "", fmt.Errorf("%s\n%s", err, strings.Join(outputs, "\n"))
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth capturing any error that occurs here and emitting an error log.

Suggested change
webhookSendErr := p.Webhooks.Send(ctx.Log, webhooks.EventResult{ Event: webhooks.ApplyEvent,
Workspace: ctx.Workspace,
User: ctx.User,
Repo: ctx.Pull.BaseRepo,
Pull: ctx.Pull,
Success: err == nil,
Directory: ctx.RepoRelDir,
ProjectName: ctx.ProjectName,
})
if webhookSendErr != nil {
ctx.Log.Err("error sending apply webhook; %v", webhookSendErr)
}
if err != nil {
return "", "", fmt.Errorf("%s\n%s", err, strings.Join(outputs, "\n"))
}

Copy link
Contributor

@abborg abborg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Webhook send failures could be emitted as logs, but as it's not currently done for the apply webhook, I don't see it as a blocker for this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New functionality/enhancement go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants