Skip to content

Remove deprecated /webhooks route and related dead code#26311

Merged
rijkvanzanten merged 13 commits intodirectus:mainfrom
mobml:cleanup/remove-deprecated-webhooks-code
Dec 24, 2025
Merged

Remove deprecated /webhooks route and related dead code#26311
rijkvanzanten merged 13 commits intodirectus:mainfrom
mobml:cleanup/remove-deprecated-webhooks-code

Conversation

@mobml
Copy link
Contributor

@mobml mobml commented Dec 4, 2025

Scope

What's changed:

  • Removed deprecated /webhooks API route
  • Removed unreachable code and unused utility imports
  • Updated references and imports accordingly
  • Added changeset (patch)

Potential Risks / Drawbacks

  • Very low risk: all removed code was already deprecated and unused
  • No public API changes
  • No behavior changes in the app

Tested Scenarios

  • All unit tests executed successfully
  • Verified that no part of the application references the removed code
  • Confirmed that API boots normally without the /webhooks route

Review Notes / Questions

  • Please confirm that no other internal tools or packages rely on the removed route
  • Let me know if additional cleanup in the services index is preferred

Checklist

  • Added or updated tests (not required; code was unused)
  • Documentation PR not required
  • OpenAPI PR not required (route already deprecated)

Fixes #26257

@mobml mobml requested a review from AlexGaillard as a code owner December 4, 2025 19:03
@mobml mobml force-pushed the cleanup/remove-deprecated-webhooks-code branch from 712f94d to d4a1b9e Compare December 4, 2025 20:43
Copy link
Member

@ComfortablyCoding ComfortablyCoding left a comment

Choose a reason for hiding this comment

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

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 WebhookService and related files
  • The directus_webhooks path in the getService function
  • The ExtensionsServices type
  • Webhook-related pages and routes in the app
  • The webhooks database table
  • Any relevant en-US translations
  • System data fields
  • SDK types & schema

The initial deprecation PR may be helpful for identifying additional areas to update: #21808

@rijkvanzanten rijkvanzanten self-assigned this Dec 24, 2025
Copy link
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 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 /webhooks API controller and route registration
  • Removed WebhooksService and all related service code and tests
  • Added database migration to drop the directus_webhooks table
  • 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

@rijkvanzanten
Copy link
Member

Thanks for kicking this off @mobml!

@codecov
Copy link

codecov bot commented Dec 24, 2025

Codecov Report

❌ Patch coverage is 5.00000% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.86%. Comparing base (9f6c797) to head (3b57e64).
⚠️ Report is 3 commits behind head on main.

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     
Flag Coverage Δ
api 44.52% <5.00%> (-0.11%) ⬇️
app 74.83% <ø> (-0.06%) ⬇️
composables 82.35% <ø> (ø)
create-directus-extension 94.44% <ø> (ø)
create-directus-project 98.43% <ø> (ø)
env 99.67% <ø> (ø)
errors 97.47% <ø> (ø)
extensions 35.63% <ø> (ø)
extensions-registry 95.27% <ø> (ø)
extensions-sdk 14.38% <ø> (ø)
format-title 100.00% <ø> (ø)
memory 95.75% <ø> (ø)
pressure 77.63% <ø> (ø)
release-notes-generator 81.14% <ø> (ø)
schema-builder 80.59% <ø> (ø)
sdk 25.95% <ø> (+0.01%) ⬆️
storage 92.00% <ø> (ø)
storage-driver-azure 76.76% <ø> (ø)
storage-driver-cloudinary 81.14% <ø> (ø)
storage-driver-gcs 69.72% <ø> (ø)
storage-driver-local 69.76% <ø> (ø)
storage-driver-s3 46.73% <ø> (ø)
storage-driver-supabase 68.63% <ø> (ø)
system-data 71.42% <ø> (-0.39%) ⬇️
update-check 55.67% <ø> (ø)
utils 90.26% <ø> (ø)
validation 44.50% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rijkvanzanten rijkvanzanten merged commit acf6d3d into directus:main Dec 24, 2025
7 checks passed
@github-actions github-actions bot added this to the Next Release milestone Dec 24, 2025
@mobml mobml deleted the cleanup/remove-deprecated-webhooks-code branch January 18, 2026 05:57
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove dead /webhooks route

4 participants