feat(add_ons): add lifecycle webhooks - #6308
Open
avanish-garg wants to merge 1 commit into
Open
Conversation
AddOn create/update/destroy fired no webhooks and produced no activity
logs at all, unlike sibling catalog resources Plan/BillableMetric/
Coupon, which all fire *.created/*.updated/*.deleted webhooks.
Adds Webhooks::AddOns::{Created,Updated,Deleted}Service mirroring the
existing BillableMetrics/Coupons webhook services, registers them in
SendWebhookJob::WEBHOOK_SERVICES, and wires the SendWebhookJob calls
into AddOns::{Create,Update,Destroy}Service.
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.
Fixes #6309
Problem
AddOnlifecycle (create/update/destroy) fires no webhooks and produces no activity logs atall, unlike sibling catalog resources
Plan,BillableMetric, andCoupon, which all fire*.created/*.updated/*.deletedwebhooks.Change
Webhooks::AddOns::{Created,Updated,Deleted}Service, mirroring the existingWebhooks::BillableMetrics::*Service/Webhooks::Coupons::*Serviceclasses exactly.SendWebhookJob::WEBHOOK_SERVICES.SendWebhookJob.perform_after_commitcalls intoAddOns::CreateService,AddOns::UpdateService, andAddOns::DestroyService.existing
AddOns::{Create,Update,Destroy}Servicespecs, and a new context in thedispatcher-level
send_webhook_job_spec.rb.Purely additive wiring -- no billing/pricing math touched.
Verified
spec/services/add_ons/*_service_spec.rb,spec/services/webhooks/add_ons/*_spec.rb,spec/jobs/send_webhook_job_spec.rb) against areal Postgres (
getlago/postgres-partman:15.0-alpine, matching CI) + Redis environment.