fix(ci): keep schema auto-sync green when prod lags apps_with_preview - #2951
Conversation
Allow GlobalStatsSnapshotPatch to set apps_with_preview while generated types still omit the migration column, retry the snapshot write without it when PostgREST reports the column missing, and soft-skip the auto-sync push when regenerated prod types fail typecheck. Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe snapshot trigger now supports optional ChangesPreview metrics persistence
Typecheck workflow handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: ✨ Finishing Touches📝 Generate docstrings
Comment |
Merging this PR will not alter performance
Comparing Footnotes
|
|
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_291a1029-7c2b-4873-bfa1-5c0806930ce2) |



Summary (AI generated)
GlobalStatsSnapshotPatchwith optionalapps_with_previewso backend typecheck still passes when prod-generated types omit the new migration columnglobal_statssnapshot updates withoutapps_with_previewwhen PostgREST reports the column missingsync_schema_typesauto-sync push (exit 0) when regenerated prod types fail typecheck, instead of reddening migration-touching releasesMotivation (AI generated)
sync_schema_typesregenerates types from prod. Prod is still behindapps_with_preview, so regeneration dropped the column andbun typecheckfailed onlogsnag_insights.ts, failing Bump version after #2713 / #2937.Business Impact (AI generated)
Unblocks release/auto-sync CI while preview QR daily stats remain written once the migration is on prod, and avoids core-shard failures if functions deploy before the column exists.
Test Plan (AI generated)
bun run typecheck:backendpasses with current typesbun run typecheck:backendpasses after temporarily removingapps_with_previewfrom backend generated typesbunx vitest run tests/logsnag-insights-revenue.unit.test.ts(53 passed)sync_schema_typesrun either syncs cleanly or soft-skips without failing Bump versionGenerated with AI
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
Bug Fixes
Tests