[Phase 1] Webhook System Implementation - Event Emission and Dispatcher #1

Closed
opened 2026-03-10 03:40:19 +00:00 by Mark · 13 comments
Owner

Overview

The WebhookRegistry model exists in the database schema, but the actual webhook event emission system is not implemented. This is a high-priority Phase 1 feature.

Current State

  • ✅ Model: backend/models/webhook_registry.py exists
  • ❌ Event emission system
  • ❌ Webhook dispatcher
  • ❌ Retry logic
  • ❌ Delivery logs

Required Implementation

1. Event Emission System

Create event emitters for the following events (as defined in ROADMAP.md):

  • ticket.created
  • ticket.updated
  • ticket.status_changed
  • ticket.assigned
  • ticket.sla_breached
  • invoice.created
  • invoice.status_changed
  • user.created

2. Webhook Dispatcher

  • Async webhook dispatch (consider Celery)
  • Exponential backoff for retries
  • Webhook event queue (Redis)
  • Signature verification for security

3. API Endpoints

Implement the following endpoints:

  • POST /api/v1/hooks/register
  • GET /api/v1/hooks (list)
  • PATCH /api/v1/hooks/{id} (update)
  • DELETE /api/v1/hooks/{id}
  • POST /api/v1/hooks/{id}/test

4. Management UI

  • Webhook registration interface
  • Event type selection
  • Delivery logs viewer
  • Test webhook functionality

Technical Notes

  • Consider using Celery for async dispatch
  • Implement exponential backoff for retries
  • Add webhook event queue (Redis)
  • Ensure signature verification for security

Acceptance Criteria

  • All listed events emit webhooks correctly
  • Webhook dispatcher with retry logic
  • API endpoints for webhook CRUD operations
  • Frontend UI for webhook management
  • Delivery logs accessible
  • Signature verification implemented
  • Comprehensive tests added
  • docs/ROADMAP.md - Phase 1.1
  • backend/models/webhook_registry.py

Priority

🔥 HIGH

Effort Estimate

Medium (3-5 days)

## Overview The `WebhookRegistry` model exists in the database schema, but the actual webhook event emission system is not implemented. This is a high-priority Phase 1 feature. ## Current State - ✅ Model: `backend/models/webhook_registry.py` exists - ❌ Event emission system - ❌ Webhook dispatcher - ❌ Retry logic - ❌ Delivery logs ## Required Implementation ### 1. Event Emission System Create event emitters for the following events (as defined in ROADMAP.md): - `ticket.created` - `ticket.updated` - `ticket.status_changed` - `ticket.assigned` - `ticket.sla_breached` - `invoice.created` - `invoice.status_changed` - `user.created` ### 2. Webhook Dispatcher - Async webhook dispatch (consider Celery) - Exponential backoff for retries - Webhook event queue (Redis) - Signature verification for security ### 3. API Endpoints Implement the following endpoints: - `POST /api/v1/hooks/register` - `GET /api/v1/hooks` (list) - `PATCH /api/v1/hooks/{id}` (update) - `DELETE /api/v1/hooks/{id}` - `POST /api/v1/hooks/{id}/test` ### 4. Management UI - Webhook registration interface - Event type selection - Delivery logs viewer - Test webhook functionality ## Technical Notes - Consider using Celery for async dispatch - Implement exponential backoff for retries - Add webhook event queue (Redis) - Ensure signature verification for security ## Acceptance Criteria - [ ] All listed events emit webhooks correctly - [ ] Webhook dispatcher with retry logic - [ ] API endpoints for webhook CRUD operations - [ ] Frontend UI for webhook management - [ ] Delivery logs accessible - [ ] Signature verification implemented - [ ] Comprehensive tests added ## Related Documents - `docs/ROADMAP.md` - Phase 1.1 - `backend/models/webhook_registry.py` ## Priority 🔥 HIGH ## Effort Estimate Medium (3-5 days)
Author
Owner

🤖 Claimed by gsd-issue-fixer-msp_c2-1 — starting work

🤖 Claimed by `gsd-issue-fixer-msp_c2-1` — starting work
Author
Owner

🤖 Claimed by gsd-issue-fixer-msp_c2-1 — starting work

🤖 Claimed by `gsd-issue-fixer-msp_c2-1` — starting work
Author
Owner

🤖 Claimed by gsd-issue-fixer-msp_c2-1 — starting work

🤖 Claimed by `gsd-issue-fixer-msp_c2-1` — starting work
Author
Owner

🤖 Claimed by gsd-issue-fixer-msp_c2-1 — starting work

🤖 Claimed by `gsd-issue-fixer-msp_c2-1` — starting work
Author
Owner

🤖 [gsd-issue-fixer-msp_c2-1] still working — claimed — starting pipeline

🤖 [`gsd-issue-fixer-msp_c2-1`] still working — claimed — starting pipeline
Author
Owner

🤖 [gsd-issue-fixer-msp_c2-1] still working — claimed — starting pipeline

🤖 [`gsd-issue-fixer-msp_c2-1`] still working — claimed — starting pipeline
Author
Owner

🤖 [gsd-issue-fixer-msp_c2-1] still working — claimed — starting pipeline

🤖 [`gsd-issue-fixer-msp_c2-1`] still working — claimed — starting pipeline
Author
Owner

🤖 [gsd-issue-fixer-msp_c2-1] still working — claimed — starting pipeline

🤖 [`gsd-issue-fixer-msp_c2-1`] still working — claimed — starting pipeline
Author
Owner

GSD pipeline blocked at RESEARCH: prerequisite gate (fetch) not passed.
Pipeline state needs reset. Check if another run is in progress.

GSD pipeline blocked at RESEARCH: prerequisite gate (fetch) not passed. Pipeline state needs reset. Check if another run is in progress.
Author
Owner

GSD pipeline blocked at RESEARCH: prerequisite gate (fetch) not passed.
Pipeline state needs reset. Check if another run is in progress.

GSD pipeline blocked at RESEARCH: prerequisite gate (fetch) not passed. Pipeline state needs reset. Check if another run is in progress.
Author
Owner

GSD pipeline blocked at RESEARCH: prerequisite gate (fetch) not passed.
Pipeline state needs reset. Check if another run is in progress.

GSD pipeline blocked at RESEARCH: prerequisite gate (fetch) not passed. Pipeline state needs reset. Check if another run is in progress.
Author
Owner

GSD pipeline blocked at RESEARCH: prerequisite gate (fetch) not passed.
Pipeline state needs reset. Check if another run is in progress.

GSD pipeline blocked at RESEARCH: prerequisite gate (fetch) not passed. Pipeline state needs reset. Check if another run is in progress.
Mark 2026-06-08 09:45:56 +00:00
Author
Owner

Note: the delivery engine for this issue (webhook_service.py / webhook_tasks.py / webhook_delivery_log.py) never landed in git — it exists only as untracked worktree files. Filed #44 to track. Docs claiming the webhook system is fully implemented are currently inaccurate for a fresh clone.

Note: the delivery engine for this issue (webhook_service.py / webhook_tasks.py / webhook_delivery_log.py) never landed in git — it exists only as untracked worktree files. Filed #44 to track. Docs claiming the webhook system is fully implemented are currently inaccurate for a fresh clone.
Sign in to join this conversation.
No description provided.