feat(replica): warn when publication tables are missing from subscription

RI
13d ago
+352-151

Summary (AI generated)

Rebased onto current main after #4000 merged. Production deploy runs a read only check after supabase db push that compares the Supabase publication capgo_google_eu_2_pub to pg_subscription_rel on Google eu-2. Missing tables or initial copy states emit GitHub warnings with the manual ALTER SUBSCRIPTION ... REFRESH PUBLICATION runbook. CI never refreshes the subscription. Release workflow tests assert the check step and that downstream deploy jobs are not gated on read_replica_schema (#4007).

Motivation (AI generated)

New publication tables can reach Supabase before the Google subscriber streams them. Operators need a visible post migration signal without blocking plugin deploys.

Business Impact (AI generated)

Reduces silent replica drift after migrations. Warnings only so production releases keep shipping while ops refresh the subscription manually.

Test Plan (AI generated)

  • bun test:unit including read-replica-subscription-publication.unit.test.ts and read-replica-release-workflow.unit.test.ts
  • Prod deploy step logs success when publication and subscription align
  • Prod deploy step logs ::warning:: when tables are missing or copying

Generated with AI

Open in Web Open in Cursor 

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Deployment
    • Production deployments now report when replica tables are missing or still copying. API, files, and plugin services can deploy before copying finishes; version lists that rely on those tables remain unavailable until copying completes.
    • When tables are missing, operators need to refresh the subscription and wait for copying to finish before relying on them in production.
  • Documentation
    • Updated replica deployment guidance to explain the new checks and required recovery steps.