webhook-inbound: default to v2, gate v1 via feature-flag+allowlist, add adoption metric & sunset warning#211
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 37 minutes and 21 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Motivation
v2the default to enforce a structured envelope and reduce garbage persisted ininbound_webhook_eventswhile preserving short-term compatibility for legacy senders.v1usage to explicitly allowlisted legacy issuers behind a feature flag to accelerate migration and limit blast radius.Description
defaultVersionfrom"1"to"2"and moved v1sunsetto2026-06-30insupabase/functions/_shared/contracts/schemas/webhook-inbound.ts.readRequestedVersionandparseAllowlisthelpers and gating logic insupabase/functions/webhook-inbound/index.tsthat enforcesWEBHOOK_INBOUND_V1_COMPAT_ENABLEDandWEBHOOK_INBOUND_V1_ALLOWLIST, returning426with codelegacy_version_blockedwhen v1 is not allowed.webhook_inbound_contract_version_adoption(endpoint, issuer, contract_version, is_default_version, requested_version) and attach explicit deprecationWarningheaders and a warning field in v1 successful responses.supabase/functions/_shared/contracts/schemas/webhook-inbound.test.tsthat assert the default (v2) rejects non-envelope payloads and that explicitv=1still parses passthrough payloads.Testing
deno test supabase/functions/_shared/contracts/schemas/webhook-inbound.test.tsbut it failed in this environment because thedenobinary is not available (deno: command not found).Codex Task
Summary by cubic
Switches the inbound webhook contract default to v2 and gates legacy v1 behind a feature flag and allowlist. Adds adoption metrics and deprecation warnings to speed migration and reduce junk payloads.
webhook-inboundcontract to v2 (strict envelope); v1 sunset set to 2026-06-30. Tests assert default rejects non-envelope and explicitv=1still parses.WEBHOOK_INBOUND_V1_COMPAT_ENABLED+WEBHOOK_INBOUND_V1_ALLOWLIST; blocked requests return 426 withlegacy_version_blocked.webhook_inbound_contract_version_adoptionlogs with endpoint, issuer, contract_version, is_default_version, and requested_version.warningfield on successful v1 responses.Written for commit 0d6186c. Summary will update on new commits. Review in cubic