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).
Before
Section titled “Before”- Pack 0e's pull request is open on the branch
be/268-repo-requestsand 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 --shortprints 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.
git fetch origin be/268-repo-requestsgit switch be/268-repo-requestspnpm supabase db resetpnpm supabase test db2 · The types and the reference pages from this schema
Section titled “2 · The types and the reference pages from this schema”pnpm db:typespnpm docs:referencegit status --short3 · apps/web still typechecks
Section titled “3 · apps/web still typechecks”pnpm typecheck4 · Commit the generated files and push them to the branch
Section titled “4 · Commit the generated files and push them to the branch”git add packages/db-types apps/docs/src/content/docs/referencegit commit -m "build(db-types): regenerate for repo requests (D33, #268)"git pushExpect
Section titled “Expect”- Block 1: "Finished supabase db reset", then
All tests successful.,Files=21, Tests=489andResult: PASS. Pack 0e's tests are the 17 in48_repo_requests.test.sql, whose descriptions startR-REP-01,R-REP-02,R-REP-03,R-REP-05,R-REP-13andR-REP-14;20_conventions.test.sqlalso checks thatrepo_requestsis audited (R-AUD-01). - Block 2:
M packages/db-types/src/database.ts, withrepo_requests,repo_request_status,repo_request_reasonandrepo_request.already_openin it, andMlines for the reference pages that list tables, enums, error keys, policies and grants. - Block 3:
apps/webfails on the new key only: its error texts have no Indonesian and English text forrepo_request.already_openyet. 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.
gh pr checks be/268-repo-requestsEvery check passes, the database job included, once the Frontend Engineer's texts are on the branch.
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 #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 --shortinto #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.