Skip to content

ci(sql-migration-gate): re-enable migration-immutability after the 0001 collapse (RIG-4897) - #2244

Open
rigel-mintaka wants to merge 1 commit into
mainfrom
compass-native/rig-4897-reenable-migration-immutability
Open

rigel-mintaka wants to merge 1 commit into
mainfrom
compass-native/rig-4897-reenable-migration-immutability

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The 0001 collapse suspended the append-only migration-immutability check so that open migration PRs could fold into 0001_init.sql before the dev database was wiped. This PR turns the check back on.

  • tools/sql-migration-gate/index.ts: the entrypoint calls checkMigrationImmutability(root) again. The hardcoded passing result is removed. The restored line matches the line in place before the suspension.
  • index.test.ts: a new test runs the real entrypoint against a temporary git repo whose base migration was edited. The test expects exit 1 and a FAIL verdict that names migration-immutability. If the check is suspended at the call site again, the suite fails.

Verification

  • bun test in tools/sql-migration-gate: 38 pass, 0 fail. The new test failed before the fix with exit 0 and the "suspended" note, and passes after it.
  • tsc reports 0 errors and biome is clean.
  • Running the real gate on this checkout prints OK — squawk + sqruff + migration-immutability passed.
  • Review: high 0, medium 0, low 0 at b7c6411.

Risks

Any open PR that still edits a migration from main fails this gate. #2212 edits 0001_init.sql, so this PR stays draft until #2212 merges, and then rebases. Rollback: revert this commit.

Compatibility

CI-only. The gate becomes stricter again. Runtime and schema do not change.

Documentation

None: the README already describes the append-only check, and the suspension never changed it.

Ledger-impact: none (restores an existing gate behaviour; no decision changes)

@trunk-io

trunk-io Bot commented Oct 12, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@linear-code

linear-code Bot commented Oct 12, 2026

Copy link
Copy Markdown

RIG-4897

@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

Review at head b7c6411: high 0, medium 0, low 0. A single review agent checked it, because the diff is a one-line restore plus one end-to-end test. This PR stays a draft until #2212 lands, because #2212 still edits 0001_init.sql.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-native-rig-4897-reen.compass-eng-docs.pages.dev

Deployed from compass-native/rig-4897-reenable-migration-immutability at 2de9020.

@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

CI at b7c6411: pgtest (and rollup, which aggregates it) is red. The cause is the job's 20-minute timeout, not this diff. All 11 real-Postgres packages reported ok at 21:07:57. The cancel landed at 21:09:37, during the next toolchain build step, after 20m22s of job time. Recent passing pgtest jobs take 17m41s to 18m38s, so this run was close to the limit. This PR touches only tools/sql-migration-gate, which pgtest does not run. Filed as RIG-5324 for the compass lane. I did not rerun this job. The PR stays a draft until #2212 lands; the rebase then will start a fresh run.

mattwilkinsonn added a commit that referenced this pull request Oct 13, 2026
* ci(pgtest): raise the job timeout to 30 minutes (RIG-5324)

Successful pgtest jobs now take 17.7 to 19.4 minutes. The -race real-Postgres suite alone takes about 17 minutes, and the sqlc-vet bootstrap still runs after it. Two recent jobs were cancelled at 20.2 and 20.4 minutes. In the #2244 run, all 11 Postgres packages had reported ok before the cancel landed during the sqlc-vet bootstrap.

Thirty minutes leaves about ten minutes of headroom over the slowest passing run. The per-package go test -timeout of 15m still catches a wedged suite.

Ledger-impact: none (CI timeout only; no recorded decision covers it)

Co-authored-by: Matt Wilkinson <matt@rigel.build>

* ci(pgtest): scope the timeout comment to the one cancelled run on record (RIG-5324)

Co-authored-by: Matt Wilkinson <matt@rigel.build>

---------

Co-authored-by: Matt Wilkinson <matt@rigel.build>
…01 collapse (RIG-4897)

The 0001 collapse suspended the append-only migration check so open migration PRs could fold into 0001_init.sql before the dev database was wiped. The wipe is done and those PRs have merged or are landing, so the gate entrypoint calls checkMigrationImmutability again instead of returning a hardcoded pass for that check.

A new test spawns the real gate entrypoint against a fixture repo with an edited base migration and expects exit 1 naming the file, so a future suspension at the call site fails the suite instead of passing silently.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka force-pushed the compass-native/rig-4897-reenable-migration-immutability branch from b7c6411 to 2de9020 Compare October 15, 2026 02:58
@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

Rebased onto main 52c78ef now that #2212 has merged. Review at head 2de9020: high 0, medium 0, low 0. bun test tools/sql-migration-gate passes 38/38, the gate runs OK on the tree, and biome and tsc are clean.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant