Remove deprecated /webhooks route and related dead code#26311
Remove deprecated /webhooks route and related dead code#26311rijkvanzanten merged 13 commits intodirectus:mainfrom
Conversation
712f94d to
d4a1b9e
Compare
There was a problem hiding this comment.
Thanks for the PR! While the endpoints have been removed, there are still remaining references and usage that should be cleaned up. In addition to any other potential occurrences, these places still reference webhooks:
- The
WebhookServiceand related files - The
directus_webhookspath in thegetServicefunction - The
ExtensionsServicestype - Webhook-related pages and routes in the app
- The webhooks database table
- Any relevant
en-UStranslations - System data fields
- SDK types & schema
The initial deprecation PR may be helpful for identifying additional areas to update: #21808
There was a problem hiding this comment.
Pull request overview
This PR removes the deprecated /webhooks API route and all related code that has been unused since webhooks were deprecated and migrated to Flows in early 2024. The changes span multiple packages including the API, SDK, types, system-data, specs, and app.
Key Changes:
- Removed the deprecated
/webhooksAPI controller and route registration - Removed WebhooksService and all related service code and tests
- Added database migration to drop the
directus_webhookstable - Removed SDK webhook commands (create, read, update, delete) and schema types
- Removed OpenAPI specifications for the deprecated webhook endpoints
- Removed UI components and routes for managing webhooks in the app
Reviewed changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| api/src/app.ts | Removed webhook router registration from Express app |
| api/src/app.test.ts | Removed webhook initialization mock |
| api/src/controllers/webhooks.ts | Deleted entire deprecated webhook controller |
| api/src/services/webhooks.ts | Deleted WebhooksService that threw deprecation errors |
| api/src/services/webhooks.test.ts | Deleted service tests |
| api/src/services/index.ts | Removed webhook service export |
| api/src/utils/get-service.ts | Removed WebhooksService import and case handling |
| api/src/database/migrations/20251224A-remove-webhooks.ts | Added migration to drop directus_webhooks table |
| api/src/database/migrations/20240311A-deprecate-webhooks.ts | Moved Webhook type definitions into migration file since types package no longer exports them |
| sdk/src/schema/webhook.ts | Deleted DirectusWebhook schema type |
| sdk/src/schema/index.ts | Removed webhook schema export |
| sdk/src/schema/core.ts | Removed DirectusWebhook from core schema |
| sdk/src/rest/commands/*/webhooks.ts | Deleted all webhook CRUD command implementations |
| sdk/src/rest/commands/*/index.ts | Removed webhook command exports |
| packages/types/src/webhooks.ts | Deleted Webhook and WebhookHeader type definitions |
| packages/types/src/services.ts | Removed WebhooksService from ExtensionsServices interface |
| packages/types/src/index.ts | Removed webhook types export |
| packages/system-data/src/fields/webhooks.yaml | Deleted webhook field definitions |
| packages/system-data/src/fields/index.ts | Removed webhook fields processing |
| packages/system-data/src/collections/collections.yaml | Removed directus_webhooks collection entry |
| packages/system-data/src/relations/relations.yaml | Removed webhook-to-flow relation definition |
| packages/specs/src/paths/webhooks/*.yaml | Deleted all webhook endpoint OpenAPI specs |
| packages/specs/src/components/webhook.yaml | Deleted webhook component schema |
| packages/specs/src/openapi.yaml | Removed webhook paths and schema references |
| app/src/modules/settings/routes/webhooks/*.vue | Deleted webhook collection and item management components |
| app/src/modules/settings/index.ts | Removed webhook route configuration |
| app/src/stores/presets.ts | Removed directus_webhooks preset configuration |
| app/src/utils/get-route.ts | Removed directus_webhooks route mapping |
| contributors.yml | Added contributor mobml |
| .changeset/lazy-insects-tap.md | Added changeset documenting the removal |
|
Thanks for kicking this off @mobml! |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #26311 +/- ##
==========================================
- Coverage 62.90% 62.86% -0.05%
==========================================
Files 2105 2098 -7
Lines 136189 135761 -428
Branches 8236 8230 -6
==========================================
- Hits 85673 85348 -325
+ Misses 50516 50413 -103
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Scope
What's changed:
/webhooksAPI routePotential Risks / Drawbacks
Tested Scenarios
/webhooksrouteReview Notes / Questions
Checklist
Fixes #26257