Repository navigation
improvement: group webhook events into cards with an example body, and let an extension add events to any group - #1032
Merged
Merged
Conversation
…d let an extension add events to any group
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The webhook dialog lists its events as cards, one per group (Issues, Comments, Agent runs), each with a box that takes the whole group, human labels and a
{ }button that opens an example of the body the event sends. An extension of the api can add events to a core group or to a group of its own.Why
The dialog showed every event as a raw name in one flat list, with nothing about what a receiver gets. An extension's events had no place of their own in it.
WebhookEventDefinitiongainsgroupandexample(the envelope'sdata).GET /projects/:projectKey/webhooks/event-types(and the MCP toollist_webhook_event_types) returns{ event, group, example }, the example being the whole body, built bywebhookBody()inmodules/webhooks/events.ts, which the deliveries use too. The core definitions and their examples live in that file.SettingsWebhookEventslays out the cards in two balanced columns (one list in the api's order on a narrow screen). An event the instance no longer offers stays in its card while the webhook has it. The edit dialog shows the signing secret with show, copy and regenerate, and the Active switch in the footer. Group and event names come fromsettings.webhooks.eventGroupsandeventTypes; one without a name is named from its key.How to test
{ }: the event name, when it is sent, the example body and how the request is signed.cd apps/api && bun test --env-file=../../.env.test src/modules/webhooks src/modules/agents/core/__tests__/integration/run-finished.test.ts: each example is compared key by key, nested objects included, with a body the webhook was really sent.Checklist
bun run typecheckpassesbun run lintandbun run format:checkpasstidy,code-reviewandsecurity-auditfrom.agents/skills/ran on the new codebun run db:generateand committed.env.exampleREADME.mdordocs/).AGENTS.mdchanged only asdocs/dev/agents-md.mdallowsbun run lintpasses;format:checkwas not run by hand, Prettier ran on the changed files in the pre-commit hook.Screenshots
Not captured. The approved mockup is the reference.