Repository navigation
Guard preview migration transaction boundaries - #322
Merged
Merged
Conversation
aRustyDev
temporarily deployed
to
preview-control-plane
November 19, 2026 01:31 — with
GitHub Actions
Inactive
aRustyDev
temporarily deployed
to
preview-control-plane
November 19, 2026 02:12 — with
GitHub Actions
Inactive
aRustyDev
marked this pull request as ready for review
November 19, 2026 02:31
Merged
This branch was previously deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Run supplied migration SQL inside a PostgreSQL exception-handling subtransaction while holding the transaction-scoped migration lock. SQL is encoded as data before constructing the guard so its contents cannot escape the wrapper. The guard protects the transaction boundary; the caller must still authorize the PR and provide restricted credentials and isolated resources.
Two historical migrations check constraint names across all schemas, causing later previews to miss constraints. For their exact original SQL, a preview-scoped catalog view fixes those checks without changing migration bytes or ledger checksums. The view is removed in the same transaction, and creation fails if an object already occupies its name.
Generated encoding tests and real PostgreSQL models cover transaction escape attempts, four preview roles on one database, checksum preservation, catalog-view collisions, and denial of writes to
public. The multi-schema model failed against the uncorrected migrations and passes with this fix. Local checks include 166 hermetic Postgres tests, formatting and clippy. Live Hyperdrive and the eventual authorized caller remain to be validated.Reference: https://www.postgresql.org/docs/current/plpgsql-transactions.html