You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Build an SQL test harness for chat RLS and storage policies, and run it in CI #583
Run the chat and storage policies against a real database, so a policy regression fails a test.
Facts
No SQL test harness exists. The guards today are static text checks plus one-shot deploy-time asserts in migrations.
Two storage regressions shipped before: ed92aaad9 and 63641764e.
No test runs these policies: author-only message writes, the block on client rows with type = 'notification', and the chat-media policies on storage.objects.
What to build
A harness against local Supabase that runs SQL as anon and as authenticated with set claims.
Cases for author-only message writes.
Cases for the refusal of client rows with type = 'notification'.
When does the CI job run? The recommended answer: on pull requests that touch packages/supabase/**, and on the weekly cron. Most runs then pay nothing, which fits #554 ruling 9.
This decision is made. The harness still lands after #554 set C (#562, #563).
Built and committed on local main. Awaits the maintainer's final push.
Remaining gate: the push, then the first CI run of the new supabase-policies job on a packages/supabase pull request and on the weekly cron. Locally: 4 files, 36 tests pass.
Status, 2026-11-03. The pgTAP harness (4 files, 36 tests) and supabase-policies.yml shipped in 60ad50001, pushed on 2026-11-03. The job has not run on GitHub yet, because the push touched no pull request. Left:
maintainer: start Supabase Policy Tests once by hand (workflow_dispatch), or wait for the Sunday cron, and confirm it passes.
The last item is met. Supabase Policy Tests ran on the weekly cron on 2026-11-08, and its job passed (run 42444903359). The pgTAP harness (4 files, 36 tests) and supabase-policies.yml shipped in 60ad50001.
Activity
HMarzban commentedon Oct 24, 2026
Maintainer ruling, 2026-10-24
When does the CI job run? The recommended answer: on pull requests that touch
packages/supabase/**, and on the weekly cron. Most runs then pay nothing, which fits #554 ruling 9.This decision is made. The harness still lands after #554 set C (#562, #563).
HMarzban commentedon Oct 24, 2026
Related, 2026-10-24
users.emailgrant.storageandpgmqdefault grants topackages/supabase/scripts/check-grants.sql.HMarzban commentedon Oct 26, 2026
Built and committed on local main. Awaits the maintainer's final push.
Remaining gate: the push, then the first CI run of the new supabase-policies job on a packages/supabase pull request and on the weekly cron. Locally: 4 files, 36 tests pass.
fix(supabase): keep the view duration when a visit closes before the …
test(supabase): add pgTAP policy tests for chat, media and erase writ…
HMarzban commentedon Nov 3, 2026
Status, 2026-11-03. The pgTAP harness (4 files, 36 tests) and
supabase-policies.ymlshipped in60ad50001, pushed on 2026-11-03. The job has not run on GitHub yet, because the push touched no pull request. Left:workflow_dispatch), or wait for the Sunday cron, and confirm it passes.fix(supabase): rebuild seed.sql from the current scripts
docs(changelog): record the image and seed.sql fixes
HMarzban commentedon Nov 10, 2026
Done, 2026-11-10. Maintainer ruling, 2026-11-10: "close".
The last item is met. Supabase Policy Tests ran on the weekly cron on 2026-11-08, and its job passed (run 42444903359). The pgTAP harness (4 files, 36 tests) and
supabase-policies.ymlshipped in60ad50001.