Webhook system for deployment notifications#2379
Webhook system for deployment notifications#2379A-D-E wants to merge 55 commits intoDokploy:canaryfrom
Conversation
- Merged upstream canary branch to get latest v0.24.10 - Updated Node.js to 20.16.0 as required - Fixed database schema with migrations - Resolved dependency issues
- Add webhook and webhook_delivery database tables - Implement complete webhook service with CRUD operations - Add webhook triggering and delivery system - Implement retry mechanism with exponential backoff - Add template formatters for Slack and n8n - Include HMAC signature generation for security - Add delivery logging with 100-entry limit per webhook
- Add webhook triggering for deployment.started event in createDeployment - Add webhook triggering for deployment.started event in createDeploymentCompose - Enhance updateDeploymentStatus to trigger success/failed/cancelled webhooks - Include full deployment context in webhook payloads - Fire webhooks asynchronously to avoid blocking deployments
- Create webhook router with full CRUD operations - Add endpoints for webhook testing and delivery history - Include batch operations and statistics endpoints - Add webhook toggle functionality - Register webhook router in main API router
- Create webhook listing component with status indicators - Add webhook form with support for Slack, n8n, and generic templates - Implement webhook deliveries modal to show webhook history - Add webhook management to application settings page - Include test webhook functionality and delivery statistics - Support enable/disable toggle and batch operations
- Add German (de) translation - Add Spanish (es) translation - Add French (fr) translation - Add Portuguese (pt-br) translation - Add Japanese (ja) translation - Add Chinese Simplified (zh-Hans) translation - Add Russian (ru) translation - Add Italian (it) translation
- Add webhook and webhook_delivery database tables - Implement complete webhook service with CRUD operations - Add webhook triggering and delivery system - Implement retry mechanism with exponential backoff - Add template formatters for Slack and n8n - Include HMAC signature generation for security - Add delivery logging with 100-entry limit per webhook
- Remove remaining i18n references in webhook components - Fix DOM nesting issue in delivery history table by removing Collapsible wrapper - Use React.Fragment with key prop to fix React warning - Fix modal closing issue by using onSelect with preventDefault - Replace hardcoded English strings throughout webhook UI
These test files are already in .gitignore and should not be tracked.
…issues - Split monolithic webhook components into modular, reusable pieces - Created standalone WebhookForm component for create/edit operations - Created dedicated WebhookHistoryModal for delivery history - Created separate WebhookEditModal and WebhookCreateModal - Fixed modal closing issues by removing conditional rendering - Created custom WebhookDialog component without overscroll-contain issue - Improved state management and separation of concerns - Fixed all linting and TypeScript errors This resolves the modal closing and scrolling issues that were preventing proper webhook management functionality. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Implement comprehensive n8n webhook template with flattened payload structure - Add Slack Block Kit template with rich formatting and interactive components - Create template configuration forms for both platforms - Add template preview component with visual Slack message preview - Implement template factory pattern for extensibility - Add validation schemas for platform-specific configurations - Create enhanced webhook service layer for integration fix: remove automatic webhook secret generation - Remove backend auto-generation of webhook secrets - Fix form to properly handle undefined secrets - Update edit modal to preserve null/undefined secret state - Ensure users have full control over webhook secret management 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…webhooks' into feature/deployment-webhooks
Siumauricio
left a comment
There was a problem hiding this comment.
I see you implemented for applications and compose, but I cannot see for compose, can you check it?
Also if you can remove the unused .md files and remove the bun.lock files since we are using pnpm
| export const WebhookCreateModal = ({ | ||
| applicationId, | ||
| composeId, | ||
| trigger, | ||
| onSuccess, | ||
| }: WebhookCreateModalProps) => { |
There was a problem hiding this comment.
Can you move the WebhookCreateModal and WebhookEditModal to handlewebhook? you can see examples where we handle the creation and the update in the same component, you can see the handle-project.tsx as an example
There was a problem hiding this comment.
refactor: consolidate webhook modals into single handle-webhook component
…nent - Create unified HandleWebhook component following handle-project pattern - Replace WebhookCreateModal and WebhookEditModal with single component - Update show-webhooks.tsx to use new HandleWebhook component - Remove deprecated modal components
9e8bc46 to
8316222
Compare
apps/dokploy/components/dashboard/application/webhooks/webhook-dialog.tsx
Outdated
Show resolved
Hide resolved
apps/dokploy/components/dashboard/application/webhooks/handle-webhook.tsx
Show resolved
Hide resolved
- Deleted 0106_mysterious_dracula.sql and 0106_nasty_silver_surfer.sql files containing webhook and webhook_delivery table definitions. - Updated _journal.json to remove references to the deleted SQL files. - Removed 0106_snapshot.json file as it is no longer needed.
…key constraints - Created new SQL files for the 'webhook' and 'webhook_delivery' tables. - Added columns and constraints to establish relationships between these tables and existing application and compose tables. - Updated the journal to include the new migration version.
…bhooks and installation scripts
- Deleted SQL files for the 'webhook' and 'webhook_delivery' tables, along with their associated foreign key constraints. - Updated _journal.json to reflect the removal of the migration version related to these tables. - Cleaned up the project by removing obsolete snapshot files.
…key constraints - Created new SQL tables for 'webhook' and 'webhook_delivery' to manage webhook events and their deliveries. - Established foreign key relationships with the 'application' and 'compose' tables. - Updated _journal.json to include the new migration version for tracking changes.
…event - Removed the 'deployment.cancelled' event from the webhook events list. - Updated type definitions for webhook handling to enforce stricter typing. - Enhanced Slack template generation by removing the cancelled message logic. - Cleaned up unused exports in webhook templates and services for better maintainability.
- Deleted the webhook basic validation test file as it is no longer needed. - This cleanup helps streamline the test suite and maintain focus on relevant tests.
…bhook handling - Eliminated the 'deployment.cancelled' event from the webhook schema and related logic. - Adjusted type definitions in the deployment service to reflect the removal of the cancelled event. - Cleaned up the payload formatting function by removing the generic case handling.
…ment.cancelled' event - Continued the cleanup of the webhook schema by removing the 'deployment.cancelled' event from the validation logic. - Updated the type definitions to ensure consistency and enforce stricter validation for webhook events.
- Deleted SQL files for the 'webhook' and 'webhook_delivery' tables, along with their associated foreign key constraints. - Updated _journal.json to reflect the removal of the migration version related to these tables. - Cleaned up the project by removing obsolete snapshot files.
- Created new tables 'webhook' and 'webhook_delivery' with necessary columns and constraints. - Established foreign key relationships with 'application' and 'compose' tables. - Updated journal and snapshot metadata for migration version 0121_dear_shooting_star.
Resolved migration conflicts by renumbering webhook migration from 0121 to 0131
Resolved migration conflicts by renumbering webhook migration from 0131 to 0133
|
Hello, @A-D-E. It is very likely that we will not proceed with this issue for now. Webhooks were recently implemented in notifications, which do almost the same thing as this, and later on I plan to review notifications so that they support when a deployment starts/ends, which is exactly what this PR does. I think adding it would mean removing it later on, so it wouldn't be ideal. I'll close this for now. Thank you very much for your work! |
This MR implements a complete webhook system that enables real-time deployment notifications and integrations with external services.
🚀 Features Added
🔧 Technical Implementation
webhookandwebhook_deliveriestables📚 Documentation
🎯 Use Cases
✅ Testing
🔒 Security
This implementation provides a solid foundation for deployment automation and team notifications while maintaining security and reliability standards.