Repository navigation
Description
Summary
The weekly "Supabase Policy Tests" run fails at its first check, Check seed.sql matches scripts/.
So the pgTAP tests have not run since 2026-11-08.
The cause is commit fbff54d6d (#755, 2026-11-12).
It edited two scripts/*.sql files but did not rebuild packages/supabase/seed.sql.
This is the second time in three weeks that seed drift has stopped this workflow.
Evidence
Source: gh run list --workflow supabase-policies.yml and gh run view <id> --log-failed, read 2026-11-22.
The workflow has only 4 runs in all, so the last 10 runs are these 4.
| Run | Started (UTC) | Event | Commit | Result | Failed step |
|---|---|---|---|---|---|
| 44986311138 | 2026-11-22 04:43 | schedule | 6da3a609e |
failure | Check seed.sql matches scripts/ |
| 43676934259 | 2026-11-15 04:28 | schedule | 9f0e2be02 |
failure | Check seed.sql matches scripts/ |
| 42444903359 | 2026-11-08 03:58 | schedule | d31ed9033 |
success | none |
| 42271557674 | 2026-11-06 18:32 | workflow_dispatch | 44be02585 |
failure | Check seed.sql matches scripts/ |
- n = 4 runs, 2026-11-06 to 2026-11-22. 3 failed and 1 passed. All 3 failures stopped at the same step.
- The runs on 2026-11-15 and 2026-11-22 show the same diff: 10 added lines and 0 removed lines, in 2 hunks.
Every added line comes from Revoke anon and public EXECUTE on three invoker notification RPCs #755. The run on 2026-11-06 had a different drift, whichf05dfeed3fixed. - In each failed run,
Start SupabaseandRun the pgTAP testswere skipped. - At
HEAD(3468060ca),grep -c '#755' packages/supabase/seed.sqlprints 0.
The same grep finds 1 line in each of the two scripts.
The lines that the check adds, from run 44986311138:
+-- Signed-in only (#755): close public and anon.
+revoke execute on function public.get_workspace_notifications(uuid, character varying, integer, integer, boolean) from public, anon;
+grant execute on function public.get_workspace_notifications(uuid, character varying, integer, integer, boolean) to authenticated;
...
+-- Signed-in only (#755): close public and anon.
+revoke execute on function public.get_unread_notifications_paginated(character varying, text, integer, integer) from public, anon;
+grant execute on function public.get_unread_notifications_paginated(character varying, text, integer, integer) to authenticated;
+revoke execute on function public.get_channel_notif_state(character varying) from public, anon;
+grant execute on function public.get_channel_notif_state(character varying) to authenticated;Cause
fbff54d6d changed scripts/07-1-notification-functions.sql (+4 lines) and scripts/10-functions.sql (+6 lines).
It added the migration 20261112120000_revoke_anon_invoker_notification_rpcs.sql too.
It did not run generate-seed.ts, so seed.sql kept the old grants.
Three gaps let the drift reach main:
- The commit went to main without a pull request. The workflow's
pull_requesttrigger never ran. - The workflow runs only on pull requests and on the weekly schedule, as the Build an SQL test harness for chat RLS and storage policies, and run it in CI #583 ruling of 2026-10-24 set.
So the next check was the Sunday schedule, up to 7 days later. check:cirunssupabase parityandsupabase grants. Neither comparesseed.sqltoscripts/.
The parity check does not compare grants and revokes.packages/supabase/CLAUDE.mdstates this limit.
This is a real repo bug, not a flake and not a runner change.
The two #755 runs print the same diff, and the step is a plain git diff --exit-code.
Impact:
- The pgTAP policy tests have not run for 14 days.
A new policy bug in that window would not show in CI. - A fresh
supabase starton empty volumes seeds from the committedseed.sql.
There,anoncan still run the three RPCs.
bun run --filter @docs.plus/supabase_back resetrebuilds the seed first, so it is not affected. - Production gets the revoke from the migration, not from
seed.sql. This issue does not change production. - No file under
packages/supabasechanged since, so the next scheduled run on 2026-11-29 fails the same way unless the seed is rebuilt.
Proposed fix
- Rebuild the seed with
bun run --filter @docs.plus/supabase_back seed, not by hand.
Commit onlypackages/supabase/seed.sql, in the same shape asf05dfeed3. - Add a
supabase seedgate toscripts/check-ci.ts, next tosupabase parityandsupabase grants.
It fails when the output ofgenerate-seed.tsdiffers from the committedseed.sql.
Givegenerate-seed.tsa--checkflag that compares in memory, so the gate does not write the file.
Step 1 alone makes the workflow pass. Step 2 stops the next drift. A push trigger on main stays out of scope: it would reopen the #583 ruling, and step 2 already catches the drift before a deploy push.
Acceptance
bun generate-seed.ts && git diff --exit-code -- seed.sqlexits 0 inpackages/supabaseat the fix commit.grep -c '#755' packages/supabase/seed.sqlprints 2.- A
workflow_dispatchrun of "Supabase Policy Tests" passes all three steps. The pgTAP step runs and passes. bun run check:cifails on a branch that edits ascripts/*.sqlfile without rebuildingseed.sql.
It passes once the seed is rebuilt.
Activity