Repository navigation
Migrations: Squawk on each new migration's SQL (sc-9611) - #268
Open
ndbroadbent wants to merge 4 commits into
Open
ndbroadbent wants to merge 4 commits into
ndbroadbent wants to merge 4 commits into
Conversation
ndbroadbent
force-pushed
the
ci-provenance
branch
from
December 5, 2026 06:04
2228502 to
1dea079
Compare
…VALID foreign keys), in the hook and the migrations job (sc-9611)
…uawk script's usage comment listed
…th no readable SQL fails, and require-concurrent-index-creation is back on (review)
ndbroadbent
force-pushed
the
ci-squawk
branch
from
December 5, 2026 06:05
2212652 to
cdfc88f
Compare
…ws the syntax, it silences nothing)
This branch has not been 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.
Eleventh PR for sc-9611: Squawk 2.74.0 (pinned in mise.toml) on new migrations. It's stacked on #267.
The migrations' SQL lives in Rust strings: raw-string consts, or literals passed straight to
tx.query(...),\line continuations included.scripts/ci/squawk_migrations.shcopies each new migration's SQL into a.sqlfile and runs Squawk on those. A migration whose SQL it can't find, such as aformat!string, fails, so nothing passes unchecked. It runs in CI'smigrationsjob, against the PR's or push's base, and in the pre-commit hook on staged migrations. Old migrations aren't checked: production ran them long ago..squawk.toml: Postgres 17, withassume_in_transactionbecause laravel-rust runs each migration in a transaction. Every rule applies except these four, each with its reason in the file:ban-drop-column:migration_safety.pyalready owns dropped columns, and knows which ones main's code still reads.prefer-identityandprefer-bigint-over-int: BIGSERIAL keys and INT counters are the schema's convention.require-statement-timeout: a backfill may run long. The requiredlock_timeoutis what keeps traffic unblocked.What it catches, run against the existing migrations: 7 had no
lock_timeout(every migration since 8 Dec sets one), 2 added foreign keys to existing tables withoutNOT VALID, and 1 dropped a constraint. AGENTS.md now says how to write these.require-concurrent-index-creationstays on:CONCURRENTLYcan't run in a transaction, so an index on an existing table blocks its writes while it builds. On a small table, a listed-- squawk-ignorewith the table's size is the way through.It starts green: there are no new migrations. Of the five newest, four pass;
diff_comment_images(a plain-string migration) has nolock_timeout. A planted older migration fails.-- squawk-ignore <rule>silences a single finding; the suppression check from #264 learns that form, so each one is listed with its reason.