feat: add webhook event for content delivery publish completion - #3757
Draft
dkrizan wants to merge 16 commits into
Draft
feat: add webhook event for content delivery publish completion#3757dkrizan wants to merge 16 commits into
dkrizan wants to merge 16 commits into
Conversation
…hooks on eventTypes
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Contributor
|
This PR is stale because it has been open for 30 days with no activity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Emits a new
CONTENT_DELIVERY_PUBLISHwebhook event when a content delivery publish completes, so consumers can react to translations being available on storage without polling or implementing their own debouncing.WebhookEventType.CONTENT_DELIVERY_PUBLISH+ payload DTO (ContentDeliveryPublishWebhookData) carried onWebhookRequest.contentDeliveryConfig.eventTypesset onWebhookConfig(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 SpringOnContentDeliveryPublishedevent (a value snapshot) — covering both manual and automated publishes.@TransactionalEventListener(AFTER_COMMIT)finds project webhooks subscribed to the event and enqueues oneWEBHOOK_DISPATCHbatch job per webhook.WebhookDeliveryManager, so signing, retry, failure-streak tracking and auto-disable behave identically.WebhookProcessornow only fires activity webhooks for webhooks subscribed toPROJECT_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.eventTypesis 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).@Schemaannotations. Docs update is a follow-up.Test plan
:data—WebhookConfigEventTypesTest(jsonb persistence),ContentDeliveryUploaderTest(event emission):ee-test—WebhookAutomationTest(5/5, incl. opt-out + unchanged activity behaviour),WebhookConfigControllerTest(13/13, incl. eventTypes create/default),ContentDeliveryPublishWebhookTest(dispatch + payload, event-type filtering, failure-streak)eslint+tscCloses #3616