Skip to content

Feat: Webhook fixes / improvements#2131

Merged
mrkaye97 merged 25 commits into
mainfrom
mk/webhooks-fixes
Aug 14, 2025
Merged

Feat: Webhook fixes / improvements#2131
mrkaye97 merged 25 commits into
mainfrom
mk/webhooks-fixes

Conversation

@mrkaye97
Copy link
Copy Markdown
Contributor

Description

  • Adding Slack as an integration + adding (basic) support for a challenge
  • Adding support for updating the expression
  • Adding headers to the CEL env
  • Docs

Type of change

  • New feature (non-breaking change which adds functionality)

@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Project Deployment Preview Comments Updated (UTC)
hatchet-docs Ready Preview Comment Aug 14, 2025 3:33pm
hatchet-v0-docs Ready Preview Comment Aug 14, 2025 3:33pm

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds Slack as a supported webhook integration and introduces several webhook improvements including the ability to update webhook expressions and enhanced CEL context.

  • Adds Slack webhook support with challenge handling and HMAC verification
  • Introduces PATCH endpoint for updating webhook event key expressions
  • Adds headers to the CEL environment for more flexible event key expressions

Reviewed Changes

Copilot reviewed 21 out of 24 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
sql/schema/v1-core.sql Adds SLACK and DISCORD to webhook source name enum
pkg/repository/v1/webhooks.go Adds UpdateWebhook method for updating expressions
internal/cel/cel.go Adds headers variable to CEL environment for webhooks
api/v1/server/handlers/v1/webhooks/receive.go Implements Slack challenge handling and validation
api/v1/server/handlers/v1/webhooks/update.go New PATCH handler for updating webhooks
frontend/app/src/pages/main/v1/webhooks/index.tsx Adds Slack webhook configuration UI

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}
}

// qq: should this be utc?
Copy link

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

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

The comment 'qq: should this be utc?' should be resolved or removed. The timestamp comparison is already using UTC (time.Unix(timestamp, 0).UTC()), so the comment appears to be outdated.

Suggested change
// qq: should this be utc?

Copilot uses AI. Check for mistakes.
Comment thread frontend/app/src/pages/main/v1/webhooks/index.tsx
Comment thread frontend/docs/pages/home/webhooks.mdx
Comment thread sql/schema/v1-core.sql Outdated

if err != nil {
return false, &ValidationError{
Code: Http500,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be a 500 response?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think so? same for the one below too (failing to compute the signature, although maybe that one is more debatable and could be e.g. 403)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ah gotcha, yeah this one looks like a correct 500, the one below does not (we'd fail if the signatures don't match right? definitely feels like a 403 instead)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ah yeah sorry, we will fail and return 403 if the signatures don't match, but that error is just checking if we fail to compute the signature, not if it doesn't match the provided one

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

got it, seems reasonable then


if err != nil {
return false, &ValidationError{
Code: Http500,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here?

@mrkaye97 mrkaye97 merged commit 3692493 into main Aug 14, 2025
43 checks passed
@mrkaye97 mrkaye97 deleted the mk/webhooks-fixes branch August 14, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants