Skip to content

BE-M0-40 · Before the merge: every test, then the generated files on pack G1b's branch

ID BE-M0-40 · Level L0 · Pack Pack G1b · Sessions and bank accounts · Run order row 22d, first: before pack G1b's pull request is merged · Issue #165

On pack G1b's branch, every pgTAP test passes on your local stack (366 in 14 files), and the generated files match G1b's schema: packages/db-types and the reference pages, committed on the same branch so the schema and what is generated from it reach main in one squashed commit (D33). The Backend Engineer's workspace can't run the Supabase stack, so pnpm db:types is yours to run; the types are only ever written by it, never by hand (D22).

  • Pack G1b's pull request is open on the branch be/pack-g1b and names #165.
  • You are in ~/opleet-v2/opleet, the local stack is running, and git status --short prints nothing.

1 · The branch, rebuilt from nothing, and every test

Section titled “1 · The branch, rebuilt from nothing, and every test”

The migration files were edited in place (D11), so the local database is rebuilt, never migrated.

Terminal window
git fetch origin be/pack-g1b
git switch be/pack-g1b
pnpm supabase db reset
pnpm supabase test db

2 · The types and the reference pages from this schema

Section titled “2 · The types and the reference pages from this schema”
Terminal window
pnpm db:types
pnpm docs:reference
git status --short
Terminal window
pnpm typecheck

4 · Only if block 2 listed a file: commit it and push

Section titled “4 · Only if block 2 listed a file: commit it and push”
Terminal window
git add packages/db-types apps/docs/src/content/docs/reference
git commit -m "build(db-types): regenerate for pack G1b (D33)"
git push
  • Block 1: "Finished supabase db reset", then "All tests successful.", "Files=14, Tests=366" and "Result: PASS". The new file is 41_access_changes.test.sql (18 tests).
  • Block 2: most likely nothing. G1b adds functions in the app schema, triggers, one policy and a column comment, none of which pnpm db:types reads, and the pull request already carries the reference pages generated from the same schema. If a file is listed, it goes into block 4's commit.
  • Block 3: no error. Nothing in G1b changes the public schema's tables, views or RPCs.
  • Block 4: skipped when block 2 printed nothing; otherwise ✔️ biome and ✔️ commitlint, then the push.

The pull request's checks:

Terminal window
gh pr checks be/pack-g1b

Every check passes: checks, pr-title and database.

  • A test fails in block 1: paste the not ok line and the lines under it starting with # into #165, and don't merge.
  • "permission denied" or "must be owner" on auth.sessions in block 1: the new triggers can't end sessions on this stack (D48). Paste it; don't merge.
  • Block 2 lists something outside packages/db-types and the reference pages: stop, and paste git status --short.
  • Block 3 fails: paste the errors into the pull request. Under D33 the Frontend Engineer fixes the named pages on the same branch; the Backend Engineer doesn't change apps/web.

Before the push: git reset --hard origin/be/pack-g1b. After it: tell the Backend Engineer on the pull request, who reverts the commit. Nothing here touches staging or production.

Log each run as a comment on #165: the date, block 1's last lines, block 2's git status --short and, if you committed, the commit's hash.