-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: Add plan webhook support #5978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: hjk1996 <[email protected]>
6b9da0f to
4a49034
Compare
|
|
||
| if err != nil { | ||
| return "", "", fmt.Errorf("%s\n%s", err, strings.Join(outputs, "\n")) | ||
| } |
There was a problem hiding this comment.
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.
| 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")) | |
| } |
abborg
left a comment
There was a problem hiding this 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.
what
why
To deliver plan results through the webhook pipeline, and to make webhook payloads/messages clearly identify which event triggered them.
tests
go test ./server/events/webhooks(passes)references