Skip to content

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.

  • 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.
Terminal window
cp -R ~/opleet-v2/packs/be-pack-b/BE-M0-20/. .
git status --short

2 · 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”
Terminal window
pnpm supabase db reset
pnpm supabase test db

3 · 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”
Terminal window
node ~/opleet-v2/packs/be-pack-b/mark-built.mjs ~/opleet-v2/packs/be-pack-b/BUILT-IDS.txt
pnpm docs:rules
git status --short apps/docs
Terminal window
git add supabase apps/docs
git 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”
Terminal window
git push -u origin supabase/schema-v13
gh 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 --watch

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:

Terminal window
gh pr merge --squash --delete-branch
git switch main
git pull
  • Block 1: ?? supabase/migrations/20261006000900_views_audit.sql and ?? supabase/tests/database/20_conventions.test.sql and ?? 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 M line 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.
Terminal window
git log --oneline -1
pnpm supabase test db

On main: “feat(supabase): schema V13 with its pgTAP tests”, then “Files=10, Tests=187” and “Result: PASS”.

  • 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.