Skip to content

feat: replace custom webhook events with consistant ping#1163

Open
stetsche wants to merge 2 commits into
masterfrom
feat/webhook-standardized-ping
Open

feat: replace custom webhook events with consistant ping#1163
stetsche wants to merge 2 commits into
masterfrom
feat/webhook-standardized-ping

Conversation

@stetsche
Copy link
Copy Markdown
Collaborator

@stetsche stetsche commented May 11, 2026

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:

Service and event refactoring:

  • Implements the ping method in WebhookService and WebhookServiceImpl, which constructs and sends a standardized ping payload envelope. (WebhookService.java, [1]; WebhookServiceImpl.java, [2]
  • Removes the legacy deliver method with explicit timestamp and the CUSTOM event type, simplifying the delivery interface. (WebhookService.java, [1]; WebhookServiceImpl.java, [2]; WebhookEventType.java, [3]
  • Adds PingWebhookEvent and updates WebhookPayloadEnvelope to support the new ping payload structure. (PingWebhookEvent.java, [1]; WebhookPayloadEnvelope.java, [2]

Dispatcher and listener adjustments:

  • Updates WebhookDeliveryDispatcher and WebhookEventListener to remove support for explicit event timestamps and custom events, aligning with the new simplified delivery contract. (WebhookDeliveryDispatcher.java, [1]; WebhookEventListener.java, [2]

Test updates:

  • Refactors integration tests to use and validate the new /ping endpoint, 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:

  • I have performed a self-review of my code
  • I have made my code as simple as possible
  • I have removed all commented code
  • I have described the PR and added a meaningful title in the Conventional Commits format
    If applicable to this PR:
  • I have added relevant tests for my changes and the code coverage has not dropped substantially
  • I have updated the documentation in all relevant places (Javadoc, Swagger, MDs...)

Copy link
Copy Markdown
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 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 (/ping endpoint, WebhookService.ping, PING event type, ping payload envelope).
  • Removed the legacy custom delivery endpoint/CUSTOM event 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
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.16%. Comparing base (7d44dd9) to head (22faec9).
⚠️ Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
...ri_eric/negotiator/webhook/WebhookServiceImpl.java 83.33% 1 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 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.

@stetsche stetsche force-pushed the feat/webhook-standardized-ping branch 3 times, most recently from b492a77 to 65a166a Compare May 13, 2026 09:02
@stetsche stetsche force-pushed the feat/webhook-standardized-ping branch from 65a166a to 22faec9 Compare May 20, 2026 08:18
@sonarqubecloud
Copy link
Copy Markdown

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Replace CUSTOM webhook event type to test deliveries with standardized PING endpoint and payload

2 participants