BE-M0-20 · Views, the audit log, the convention checks and the pull request
ID BE-M0-20 · Level L0 · Pack Pack B · Schema V13, domain by domain · Run order row 19 · Issue #11
The views, the audit log and the convention checks pass with every earlier test (187 in 10 files), the 134 rules pack B proves are marked built, and pack B is merged into main through a pull request.
Before
Section titled “Before”- BE-M0-19 is Done. You are on the branch supabase/schema-v13 in ~/opleet-v2/opleet, git status --short prints nothing, and the stack is running.
1 · Copy this step's files in
Section titled “1 · Copy this step's files in”cp -R ~/opleet-v2/packs/be-pack-b/BE-M0-20/. .git status --short2 · Rebuild the local database from every migration, then run every test
Section titled “2 · Rebuild the local database from every migration, then run every test”pnpm supabase db resetpnpm supabase test db3 · Mark the rules pack B proves as built, then run the rule check
Section titled “3 · Mark the rules pack B proves as built, then run the rule check”node ~/opleet-v2/packs/be-pack-b/mark-built.mjs ~/opleet-v2/packs/be-pack-b/BUILT-IDS.txtpnpm docs:rulesgit status --short apps/docs4 · Commit
Section titled “4 · Commit”git add supabase apps/docsgit commit -m "feat(supabase): views, the audit log and the convention checks"5 · Push, open the pull request and wait for its checks
Section titled “5 · Push, open the pull request and wait for its checks”git push -u origin supabase/schema-v13gh pr create --title "feat(supabase): schema V13 with its pgTAP tests" --body "BE pack B (BE-M0-12 to BE-M0-20), timeline row 19. Closes #11."gh pr checks --watch6 · Log the run on #11, then merge
Section titled “6 · Log the run on #11, then merge”Comment on #11 with the date, what you ran in BE-M0-12 to BE-M0-20 and the output of each test run and of block 3. Then:
gh pr merge --squash --delete-branchgit switch maingit pullExpect
Section titled “Expect”- Block 1:
?? supabase/migrations/20261006000900_views_audit.sqland?? supabase/tests/database/20_conventions.test.sqland?? supabase/tests/database/20_views_audit.test.sql. - Block 2: db reset applies 20261006000900_views_audit.sql last and ends with “Finished supabase db reset”; test db ends with “All tests successful.”, “Files=10, Tests=187” and “Result: PASS”.
- Block 3: “Marked built: 134. Already built: 0.”, then the rule check's “Rules: …” line with no line under it, then a
Mline for each rule page that changed. - Block 4: the commit line, with the three supabase files and the rule pages.
- Block 5: the pull request's URL; checks and pr-title pass.
- Block 6: “✓ Squashed and merged pull request #…”, and main moves to that commit.
git log --oneline -1pnpm supabase test dbOn main: “feat(supabase): schema V13 with its pgTAP tests”, then “Files=10, Tests=187” and “Result: PASS”.
If it fails
Section titled “If it fails”- db reset stops at a migration: the error names the file and the line. Paste it into the BE chat; don't edit the file.
- test db prints “not ok”: paste every “not ok” line and the lines under it. Don't commit.
- The stack isn't running:
pnpm supabase start, then the rebuild and tests again. - Block 3 prints “Not found in apps/docs” or “Retired”, or docs:rules prints a line under its “Rules:” line: a test cites a rule ID apps/docs doesn't define as this pack expects. Paste the output into the BE chat; BE rebuilds the pack.
- A check fails on the pull request: paste the failing job's log.
Before merging: gh pr close --delete-branch, then git switch main and pnpm supabase db reset. After merging: revert it with a new pull request.
Not run yet. Log each run as a comment on #11.