Skip to content

fix(types): add delivery_version to webhooks + webhook_deliveries (main typecheck broken)#2298

Merged
WcaleNieWolny merged 1 commit into
mainfrom
fix/webhooks-delivery-version-types
May 19, 2026
Merged

fix(types): add delivery_version to webhooks + webhook_deliveries (main typecheck broken)#2298
WcaleNieWolny merged 1 commit into
mainfrom
fix/webhooks-delivery-version-types

Conversation

@WcaleNieWolny
Copy link
Copy Markdown
Contributor

@WcaleNieWolny WcaleNieWolny commented May 19, 2026

Main is currently red

Run: https://github.com/Cap-go/capgo/actions/runs/26091284919/job/76718009686

src/components/WebhookForm.vue(36,44): error TS2339: Property 'delivery_version' does not exist on type 'Webhook'.
src/pages/settings/organization/Webhooks.vue(271,18): error TS2339: ...
supabase/functions/_backend/public/webhooks/post.ts(53,6): error TS2769: ...
supabase/functions/_backend/triggers/webhook_delivery.ts(113,70): error TS2339: ...
supabase/functions/_backend/triggers/webhook_dispatcher.ts(84,73): error TS2339: ...
supabase/functions/_backend/utils/webhook.ts(220,6): error TS2769: ...
... and more in webhooks/put.ts, webhooks/test.ts

Root cause

Migration 20260518121000_standard_webhook_secrets.sql added delivery_version columns to both webhooks and webhook_deliveries tables. The webhook code (Vue components, edge functions, triggers, utils) was updated to reference these columns. But neither supabase.types.ts (backend nor frontend copy) was regenerated alongside the migration, so the type system doesn't know the column exists.

This broke main's typecheck. Because typecheck is part of build_and_deploy.yml, the consequence is downstream:

  • supabase_deploy ✗ (typecheck failure)
  • deploy_webapp / deploy_files / deploy_api / Plugin / Translation deploys ⏭ (all skipped)

So the AI build analytics feature that just merged in #2284 has NOT actually deployed to prod yet, and won't until typecheck is green.

Fix

Surgical additions to both supabase.types.ts copies — delivery_version: string on the Row, delivery_version?: string on Insert + Update (it has a DEFAULT 'legacy' so it's optional), for both webhooks and webhook_deliveries. Same approach we used for ai_analyzed earlier — avoids the unrelated drift a full supabase gen types regen would introduce.

8 simple field additions, +12 lines / -0 lines.

Test plan

  • Local typecheck passes (bun typecheck)
  • CI typecheck passes on this branch
  • After merge → next bump+tag → build_and_deploy.yml reaches Apply Supabase Migrations and downstream deploys succeed
  • Confirm AI analytics feature is finally live in prod after the deploy chain completes

Summary by CodeRabbit

  • Chores
    • Enhanced database schema to support version tracking for webhook deliveries and webhooks, enabling better management and traceability of webhook operations.

Review Change Stack

Pre-existing types drift on main — migration 20260518121000_standard_webhook_secrets.sql
added `delivery_version` columns to both tables but neither
supabase.types.ts (backend nor frontend copy) was regenerated. Main's
typecheck has been broken since that migration merged; our PR caught it
because we run typecheck in CI.

Surgical additions to keep the diff scoped and avoid the unrelated drift
a full `supabase gen types` would introduce. Same approach we used for
ai_analyzed earlier in this PR.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR extends Supabase database TypeScript type definitions to include a new delivery_version: string field on both webhook_deliveries and webhooks tables. The field is required on Row types and optional on Insert and Update types, synchronized across main codebase types and Supabase functions utility types.

Changes

Webhook Schema Extensions

Layer / File(s) Summary
webhook_deliveries type extension
src/types/supabase.types.ts, supabase/functions/_backend/utils/supabase.types.ts
webhook_deliveries Row, Insert, and Update types gain delivery_version field: required on Row, optional on Insert and Update.
webhooks type extension
src/types/supabase.types.ts, supabase/functions/_backend/utils/supabase.types.ts
webhooks Row, Insert, and Update types gain delivery_version field: required on Row, optional on Insert and Update.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A version field hops into the scene,
Webhooks and deliveries now pristine,
Types align with synchronized grace,
Delivery tracking finds its place! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding delivery_version field to webhook-related types to fix a typecheck failure.
Description check ✅ Passed The description is comprehensive and well-structured, including summary, root cause analysis, fix explanation, and detailed test plan covering local and CI verification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/webhooks-delivery-version-types

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

@codspeed-hq
Copy link
Copy Markdown
Contributor

codspeed-hq Bot commented May 19, 2026

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing fix/webhooks-delivery-version-types (0e12300) with main (57e27b5)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@WcaleNieWolny WcaleNieWolny merged commit 64d9104 into main May 19, 2026
48 of 52 checks passed
@WcaleNieWolny WcaleNieWolny deleted the fix/webhooks-delivery-version-types branch May 19, 2026 10:48
@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.

1 participant