BE-DP-37 · Before the merge: the repo work order's tests, then the generated files
ID BE-DP-37 · Level L0 · Pack Row 0i · The repo work order in the schema · Run order row 0i, before the row 0i pull request is merged · Issue #357
On the row 0i branch, every pgTAP test passes on your Mac's local stack, and the generated files match the new schema (D33). The branch adds:
- three tables to
public,repo_work_orders,repo_work_order_unitsandrepo_work_order_pics, with two enums, three error keys and the read policies (R-REP-15 to R-REP-27); - the helpers
app.repo_work_order_pool,app.repo_request_partnerandapp.repo_work_order_has_my_partner, and the trigger functionapp.repo_work_order_units_guard.
So pnpm db:types and pnpm docs:reference will change files this time. No generated file is written by hand (D22).
Before
Section titled “Before”- The row 0i pull request is open on its branch (
team/357-repo-work-order-tables), with DOC's rules and BE's commits, and its body names #357. - You are at the root of your clone, the local stack is running, and
git status --shortprints nothing.
1 · The branch, rebuilt from nothing, and every test
Section titled “1 · The branch, rebuilt from nothing, and every test”git fetch origin team/357-repo-work-order-tablesgit switch team/357-repo-work-order-tablespnpm supabase db resetpnpm supabase test db2 · The generated policies match their spec
Section titled “2 · The generated policies match their spec”python3 tools/db/gen_rls.pygit status --short3 · The types and the reference pages from this schema
Section titled “3 · The types and the reference pages from this schema”pnpm db:typespnpm docs:referencegit status --short4 · Commit what block 3 changed
Section titled “4 · Commit what block 3 changed”git add packages/db-types apps/docs/src/content/docs/referencegit commit -m "build(db-types): regenerate for the repo work order (D33, #357)"git pushExpect
Section titled “Expect”- Block 1: "Finished supabase db reset", then
All tests successful.andResult: PASS. The new tests are the 32 in57_repo_work_orders.test.sql(R-REP-15 to R-REP-27), and one changed line in20_conventions.test.sql(R-CONV-08:repo_work_order_picshas noupdated_at, as a link row). - Block 2:
git status --shortprints nothing (the committed20261006001100_rls.sqlis what the script writes). - Block 3:
packages/db-types/src/database.ts,reference/tables.md,reference/policies.mdand the Error keys page change. - Block 4: one commit, pushed.
gh pr checks team/357-repo-work-order-tablesEvery check passes.
If it fails
Section titled “If it fails”- A test fails in block 1: paste the
not okline and the lines under it that start with#into #357. Don't edit the test, and don't merge. - Block 2 prints a file: say which on the pull request; the Backend Engineer regenerates it.
- Block 3 changes a file outside
packages/db-typesandreference/: say which on the pull request.
git switch main and pnpm supabase db reset. Nothing here touches staging or production.
Log each run as a comment on #357: date · who · result, with block 1's last lines and block 3's file list.