Skip to content

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_units and repo_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_partner and app.repo_work_order_has_my_partner, and the trigger function app.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).

  • 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 --short prints nothing.

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

Section titled “1 · The branch, rebuilt from nothing, and every test”
Terminal window
git fetch origin team/357-repo-work-order-tables
git switch team/357-repo-work-order-tables
pnpm supabase db reset
pnpm supabase test db

2 · The generated policies match their spec

Section titled “2 · The generated policies match their spec”
Terminal window
python3 tools/db/gen_rls.py
git status --short

3 · The types and the reference pages from this schema

Section titled “3 · The types and the reference pages from this schema”
Terminal window
pnpm db:types
pnpm docs:reference
git status --short
Terminal window
git add packages/db-types apps/docs/src/content/docs/reference
git commit -m "build(db-types): regenerate for the repo work order (D33, #357)"
git push
  • Block 1: "Finished supabase db reset", then All tests successful. and Result: PASS. The new tests are the 32 in 57_repo_work_orders.test.sql (R-REP-15 to R-REP-27), and one changed line in 20_conventions.test.sql (R-CONV-08: repo_work_order_pics has no updated_at, as a link row).
  • Block 2: git status --short prints nothing (the committed 20261006001100_rls.sql is what the script writes).
  • Block 3: packages/db-types/src/database.ts, reference/tables.md, reference/policies.md and the Error keys page change.
  • Block 4: one commit, pushed.
Terminal window
gh pr checks team/357-repo-work-order-tables

Every check passes.

  • A test fails in block 1: paste the not ok line 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-types and reference/: 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.