Skip to content

BE-DP-17 · Before the merge: the repo request's tests, then the generated files

ID BE-DP-17 · Level L0 · Pack Pack 0e · The repo request · Run order row 0e, before pack 0e's pull request is merged · Issue #268

On pack 0e's branch, every pgTAP test passes on your Mac's local stack, the repo request's 17 included, and packages/db-types and the reference pages hold what pnpm db:types and pnpm docs:reference generate from its schema (D33). The pack adds the table repo_requests, the enums repo_request_status and repo_request_reason, and the key repo_request.already_open, so both change. The Backend Engineer's workspace can't run the Supabase stack, so the two commands are yours to run; neither file is ever written by hand (D22).

  • Pack 0e's pull request is open on the branch be/268-repo-requests and names #268. DOC's R-REP rules are on main (#274, #276). Its database job fails on "The generated files match the schema" until this step's commit lands.
  • No other schema pull request has merged since the branch was last rebased onto main; if one has, say so on the pull request and the Backend Engineer rebases first (one schema pull request merges at a time).
  • 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”

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

Terminal window
git fetch origin be/268-repo-requests
git switch be/268-repo-requests
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 · Commit the generated files and push them to the branch

Section titled “4 · Commit the generated files and push them to the branch”
Terminal window
git add packages/db-types apps/docs/src/content/docs/reference
git commit -m "build(db-types): regenerate for repo requests (D33, #268)"
git push
  • Block 1: "Finished supabase db reset", then All tests successful., Files=21, Tests=489 and Result: PASS. Pack 0e's tests are the 17 in 48_repo_requests.test.sql, whose descriptions start R-REP-01, R-REP-02, R-REP-03, R-REP-05, R-REP-13 and R-REP-14; 20_conventions.test.sql also checks that repo_requests is audited (R-AUD-01).
  • Block 2: M packages/db-types/src/database.ts, with repo_requests, repo_request_status, repo_request_reason and repo_request.already_open in it, and M lines for the reference pages that list tables, enums, error keys, policies and grants.
  • Block 3: apps/web fails on the new key only: its error texts have no Indonesian and English text for repo_request.already_open yet. Under D33 the Frontend Engineer adds them on this branch before the merge; then block 3 prints no error. Any other error: see below.
  • Block 4: ✔️ biome and ✔️ commitlint, then the push. The database job turns green.
Terminal window
gh pr checks be/268-repo-requests

Every check passes, the database job included, once the Frontend Engineer's texts are on the branch.

  • A test fails in block 1: paste the not ok line and the lines under it that start with # into #268. The test's description starts with the rule it proves. Don't edit the test, and don't merge.
  • Block 2 lists something outside packages/db-types and the reference pages: stop, and paste git status --short into #268.
  • Block 3 fails on anything but repo_request.already_open: paste the errors into the pull request, and don't merge.

Before the push: git reset --hard origin/be/268-repo-requests. After it: say so on the pull request, and the Backend Engineer reverts the commit. git switch main and pnpm supabase db reset put your local database back on main's schema. Nothing here touches staging or production.

Log each run as a comment on #268: date · who · result · notes, with block 1's last lines, block 2's git status --short and the commit's hash.