feat: replace custom webhook events with consistant ping#1163
Conversation
There was a problem hiding this comment.
Pull request overview
This PR standardizes webhook “test” deliveries by introducing a dedicated /v3/webhooks/{id}/ping endpoint and corresponding WebhookService.ping(...) flow, while removing the legacy custom delivery mechanism and timestamp-passing delivery contract.
Changes:
- Added a standardized webhook ping mechanism (
/pingendpoint,WebhookService.ping,PINGevent type, ping payload envelope). - Removed the legacy custom delivery endpoint/
CUSTOMevent path and simplified dispatcher/listener/service delivery signatures (no explicit occurred-at parameter). - Updated frontend admin store and backend unit/integration tests to use and validate the new ping behavior.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/store/admin.js | Switches “test webhook” action to call the new /ping endpoint and updates the failure message. |
| backend/src/main/java/eu/bbmri_eric/negotiator/webhook/WebhookController.java | Replaces the legacy custom delivery endpoint with /v3/webhooks/{id}/ping. |
| backend/src/main/java/eu/bbmri_eric/negotiator/webhook/WebhookService.java | Adds ping(...) to the service API and removes the explicit-timestamp deliver overload. |
| backend/src/main/java/eu/bbmri_eric/negotiator/webhook/WebhookServiceImpl.java | Implements ping(...), refactors delivery logic to remove custom wrapping, and centralizes payload serialization. |
| backend/src/main/java/eu/bbmri_eric/negotiator/webhook/WebhookDeliveryDispatcher.java | Simplifies scheduling to remove the explicit occurred-at argument. |
| backend/src/main/java/eu/bbmri_eric/negotiator/webhook/WebhookEventListener.java | Updates dispatching to match the new dispatcher/service delivery signature. |
| backend/src/main/java/eu/bbmri_eric/negotiator/webhook/event/WebhookPayloadEnvelope.java | Adds a ping envelope factory producing the standardized ping payload. |
| backend/src/main/java/eu/bbmri_eric/negotiator/webhook/event/WebhookEventType.java | Removes CUSTOM and adds PING. |
| backend/src/main/java/eu/bbmri_eric/negotiator/webhook/event/PingWebhookEvent.java | Introduces the ping payload DTO (record). |
| backend/src/test/java/eu/bbmri_eric/negotiator/webhook/WebhookEventListenerTest.java | Updates expectations for the refactored dispatcher signature. |
| backend/src/test/java/eu/bbmri_eric/negotiator/webhook/WebhookDeliveryDispatcherTest.java | Updates dispatcher test for the new scheduleDelivery(...) signature. |
| backend/src/test/java/eu/bbmri_eric/negotiator/webhook/WebhookDeliveryPersisterTest.java | Updates delivery event type expectations from CUSTOM to PING. |
| backend/src/test/java/eu/bbmri_eric/negotiator/unit/model/WebhookEntityTest.java | Updates delivery event type expectations from CUSTOM to PING. |
| backend/src/test/java/eu/bbmri_eric/negotiator/integration/api/WebhookControllerTest.java | Refactors API integration tests to validate /ping and assert the legacy /deliveries endpoint is removed. |
| backend/src/test/java/eu/bbmri_eric/negotiator/integration/service/WebhookSignatureReferenceVerificationIntegrationTest.java | Updates signature verification integration test to use ping(...). |
| backend/src/test/java/eu/bbmri_eric/negotiator/integration/service/WebhookRedeliveryIntegrationTest.java | Updates redelivery test flows to start from a ping delivery. |
| backend/src/test/java/eu/bbmri_eric/negotiator/integration/service/WebhookDeliveryTransportFaultIntegrationTest.java | Updates transport-fault delivery tests to use ping(...). |
| backend/src/test/java/eu/bbmri_eric/negotiator/integration/service/WebhookDeliveryTransactionBoundaryIntegrationTest.java | Updates concurrency/transaction boundary test to use ping(...). |
| backend/src/test/java/eu/bbmri_eric/negotiator/integration/service/WebhookDeliverySslIntegrationTest.java | Updates SSL delivery tests to use ping(...). |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1163 +/- ##
============================================
+ Coverage 86.15% 86.16% +0.01%
Complexity 2313 2313
============================================
Files 291 292 +1
Lines 6442 6440 -2
Branches 402 400 -2
============================================
- Hits 5550 5549 -1
Misses 638 638
+ Partials 254 253 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b492a77 to
65a166a
Compare
65a166a to
22faec9
Compare
|
|



Description:
This pull request introduces a new standardized "ping" delivery endpoint for webhooks, removes the legacy custom delivery endpoint, and refactors related service and event code to support the new ping mechanism. It also updates the integration tests to validate the new ping behavior and cleans up unused code paths and event types.
Webhook Ping Delivery Feature and Refactor
API changes:
/v3/webhooks/{id}/pingendpoint to send a standardized ping payload to the specified webhook, replacing the previous custom delivery endpoint. (WebhookController.java, backend/src/main/java/eu/bbmri_eric/negotiator/webhook/WebhookController.javaL79-R81)WebhookController.java, [1];WebhookEventType.java, [2]Service and event refactoring:
pingmethod inWebhookServiceandWebhookServiceImpl, which constructs and sends a standardized ping payload envelope. (WebhookService.java, [1];WebhookServiceImpl.java, [2]delivermethod with explicit timestamp and theCUSTOMevent type, simplifying the delivery interface. (WebhookService.java, [1];WebhookServiceImpl.java, [2];WebhookEventType.java, [3]PingWebhookEventand updatesWebhookPayloadEnvelopeto support the new ping payload structure. (PingWebhookEvent.java, [1];WebhookPayloadEnvelope.java, [2]Dispatcher and listener adjustments:
WebhookDeliveryDispatcherandWebhookEventListenerto remove support for explicit event timestamps and custom events, aligning with the new simplified delivery contract. (WebhookDeliveryDispatcher.java, [1];WebhookEventListener.java, [2]Test updates:
/pingendpoint, including tests for successful delivery, error handling, and payload verification. (WebhookControllerTest.java, [1] [2] [3] [4] [5] [6]Checklist:
Make sure you tick all the boxes below if they are true or do not apply before you ask for review
Required for all pull requests:
If applicable to this PR: