Skip to content

feat: add webhook event for content delivery publish completion - #3757

Draft
dkrizan wants to merge 16 commits into
mainfrom
dkrizan/content-delivery-publish-webhook
Draft

feat: add webhook event for content delivery publish completion#3757
dkrizan wants to merge 16 commits into
mainfrom
dkrizan/content-delivery-publish-webhook

Conversation

@dkrizan

@dkrizan dkrizan commented Jun 16, 2026

Copy link
Copy Markdown
Member

Summary

Emits a new CONTENT_DELIVERY_PUBLISH webhook event when a content delivery publish completes, so consumers can react to translations being available on storage without polling or implementing their own debouncing.

  • New WebhookEventType.CONTENT_DELIVERY_PUBLISH + payload DTO (ContentDeliveryPublishWebhookData) carried on WebhookRequest.contentDeliveryConfig.
  • Opt-in via a new eventTypes set on WebhookConfig (jsonb). Existing webhooks are backfilled to ["PROJECT_ACTIVITY"], so their behaviour is unchanged. Exposed in the EE webhook config API and the webapp webhook form.
  • ContentDeliveryUploader.upload() publishes a Spring OnContentDeliveryPublished event (a value snapshot) — covering both manual and automated publishes.
  • An EE @TransactionalEventListener(AFTER_COMMIT) finds project webhooks subscribed to the event and enqueues one WEBHOOK_DISPATCH batch job per webhook.
  • The new dispatch path and the existing activity path both delegate to a shared WebhookDeliveryManager, so signing, retry, failure-streak tracking and auto-disable behave identically.
  • WebhookProcessor now only fires activity webhooks for webhooks subscribed to PROJECT_ACTIVITY.

Payload

{
  "webhookConfigId": 123,
  "projectId": 10,
  "eventType": "CONTENT_DELIVERY_PUBLISH",
  "activityData": null,
  "contentDeliveryConfig": {
    "projectId": 10,
    "id": 55,
    "name": "Production CDN",
    "slug": "abc123",
    "lastPublished": 1718539200000,
    "files": ["en.json", "de.json"]
  }
}

Notes

  • WebhookConfig.eventTypes is intentionally @ActivityIgnoredProp: logging it would emit a WebhookConfig activity on every save, which re-triggers the webhook automation and recursively fires webhooks (caught and fixed during review; covered by a regression test).
  • Storage-level signal only — CDN edge propagation remains the consumer's responsibility.
  • User-facing webhook docs live in the external docs repo; the payload is self-documented via OpenAPI @Schema annotations. Docs update is a follow-up.

Test plan

  • :dataWebhookConfigEventTypesTest (jsonb persistence), ContentDeliveryUploaderTest (event emission)
  • :ee-testWebhookAutomationTest (5/5, incl. opt-out + unchanged activity behaviour), WebhookConfigControllerTest (13/13, incl. eventTypes create/default), ContentDeliveryPublishWebhookTest (dispatch + payload, event-type filtering, failure-streak)
  • Frontend eslint + tsc
  • CI green

Closes #3616

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d46cd7d8-3b59-4a3e-86f0-b0abe2760eeb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dkrizan/content-delivery-publish-webhook

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale label Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add event/webhook for content delivery publish completion

1 participant