Repository navigation
ENG-2476 Run the schema-versus-migrations check in CI - #1616
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
| - name: Check schema files against migrations | ||
| working-directory: ./packages/database | ||
| run: pnpm run check-schema |
There was a problem hiding this comment.
🟡 Workflow-only changes skip the schema check
When a PR changes only the workflow, check-schema never runs. The pull_request.paths filter excludes workflow files, leaving changes to this check untested.
Learn more
This workflow runs only when a pull request changes a file under packages/database/**. The new schema check is added solely to the workflow, so the current PR does not trigger the database job. Later changes confined to the check also skip it.
Example: A PR edits only the Install sqruff step. GitHub skips Database tests, so the modified installation and schema check receive no CI run.
Recommended fix: Add the workflow itself to pull_request.paths so CI runs when its configuration changes, as well as when database files change.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
I think that workflow changes need not trigger a lint run.
f2c6ac1 to
cbf1ffe
Compare
cbf1ffe to
3d803bf
Compare
Reviewer brief
#1615(ENG-2477):check-schemafails onmainuntil that migration lands.sqruffinstall step.lintSchemas.tspasses silently whensqruffis missing, so without it CI would skip the lint. The version is hard-coded on purpose; pinning it in one place is out of scope (see the comment on ENG-2476).Verification
pnpm run check-schemaon this branch, locally: passes in about 7 seconds.packages/databaseto trigger the workflow. The new steps take about 61 seconds, mostly pulling the Postgres image. "Setup database" then reuses that image and drops from 102 to 76 seconds compared with the run on#1615, so the job is about 35 seconds longer.COMMENT ONand no migration: fails with "The schema files differ from the migrations."account.sql: fails on LT01 in about a second;dbdiffdoesn't run.Loom video
https://www.loom.com/share/e6c88dd042be43a78ba5d0f88f6c0f14
Scope check
$scope-checkagainst ENG-2476 and the final diff.Done When: None.Standards check
$dg-pr-adherence-checkagainst the final diff and PR metadata.Local delegated full review
$dg-delegated-full-reviewwhen no other full-review workflow is available.https://linear.app/discourse-graphs/issue/ENG-2476/run-the-schema-versus-migrations-check-in-ci