You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Catch concurrent constraint creation races in the webhook delivery reconciliation migration.
Guard concurrent index creation races observed in disposable Postgres.
Extend migration packaging assertions for concurrency handlers.
Internal source PR: evalops/maestro-internal#1515
Test plan:
npm run test -- test/web-health.test.ts test/db/migration-files.test.ts test/db/migrate-legacy-reconciliation.test.ts
bunx biome check test/db/migration-files.test.ts
git diff --check
Disposable Postgres 16: ran 0008 migration twice concurrently against a drifted legacy webhook_deliveries schema and verified helper, PK, FK, indexes, status normalization, and invalid payload wrapping.
Medium Risk
Touches a production database migration by adding exception-handling around constraint/index creation; behavior should be unchanged, but migration execution paths can vary across Postgres versions and drifted schemas.
Overview
Hardens the 0008_reconcile_legacy_webhook_deliveries migration against concurrent runs by wrapping primary key / foreign key constraint creation in BEGIN … EXCEPTION blocks to ignore duplicate/invalid-definition races.
Similarly guards index creation on webhook_deliveries to tolerate concurrent CREATE INDEX IF NOT EXISTS races (duplicate_table/unique_violation). Tests are updated to assert these new concurrency-handling clauses are present in the packaged migration SQL.
Reviewed by Cursor Bugbot for commit 0ffd0f7. Bugbot is set up for automated code reviews on this repo. Configure here.
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
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.
Summary:
Internal source PR: evalops/maestro-internal#1515
Test plan: