Skip to content

fix(cli): stop db dump dropping function privileges (CLI-3299) - #7858

Open
7ttp wants to merge 1 commit into
developfrom
7ttp/cli-3299-db-dump-drops-grant-and-revoke-lines-for
Open

7ttp wants to merge 1 commit into
developfrom
7ttp/cli-3299-db-dump-drops-grant-and-revoke-lines-for

Conversation

@7ttp

@7ttp 7ttp commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

TL;DR

stops db dump dropping the privileges of functions that take an extension type like vector, which left them open to anon after a restore

whats missing?

the filter that leaves out privileges on Supabase managed schemas matched a schema name anywhere on the line, so a public function with an extensions.vector argument lost its REVOKE ... FROM PUBLIC
in migration squash and db pull --diff-engine migra too

now fixed by:

matching only the schema the object itself lives in, so those lines stay in the dump,
grants to a role named like a managed schema such as pgbouncer stay too, and privileges on auth, extensions and the other managed schemas are still left out

ref:

@7ttp 7ttp self-assigned this Nov 29, 2026
@7ttp
7ttp requested a review from a team as a code owner November 29, 2026 22:53
@7ttp
7ttp requested a review from kanadgupta November 29, 2026 22:53
@github-actions

Copy link
Copy Markdown
Contributor

CLI benchmark (Lightweight Commands): no changes found

Commit a7af4a4 against develop at ac0a22a · 10 runs each · report only, never blocks merging

Command Workload Before After Change
supabase --version version 155 ms 156 ms no real change
supabase --help help 158 ms 157 ms no real change
supabase init init 158 ms 157 ms no real change
supabase migration new bench migration-new 162 ms 161 ms no real change
supabase config convert config-convert 164 ms 164 ms no real change
supabase config validate config-validate 171 ms 172 ms no real change
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 183 ms 184 ms no real change
supabase projects list projects-list 168 ms 168 ms no real change
supabase functions list --project-ref replayfixtureprojref functions-list 172 ms 176 ms no real change

API calls: unchanged for all 9 commands.

Binary size: 135.7 MB, unchanged.

Details: timing ranges, API calls per command, slowest phases

Timing ranges

Command Workload Before range After range Change Verdict
supabase --version version 152-163 ms 149-162 ms +1 ms (+1%) within noise
supabase --help help 153-172 ms 154-166 ms 0 ms (0%) within noise
supabase init init 156-162 ms 157-163 ms -1 ms (-1%) within noise
supabase migration new bench migration-new 160-166 ms 160-176 ms -2 ms (-1%) within noise
supabase config convert config-convert 160-168 ms 161-170 ms +1 ms (+0%) within noise
supabase config validate config-validate 170-175 ms 170-184 ms +1 ms (+0%) within noise
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 181-201 ms 180-201 ms +1 ms (+1%) within noise
supabase projects list projects-list 165-178 ms 167-180 ms +0 ms (+0%) within noise
supabase functions list --project-ref replayfixtureprojref functions-list 170-180 ms 171-188 ms +4 ms (+2%) within noise

API calls per command

Command Workload Before After Endpoint changes
supabase --version version 0 0
supabase --help help 0 0
supabase init init 0 0
supabase migration new bench migration-new 0 0
supabase config convert config-convert 0 0
supabase config validate config-validate 0 0
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 2 2
supabase projects list projects-list 1 1
supabase functions list --project-ref replayfixtureprojref functions-list 2 2

Slowest phases

No command moved beyond noise, so there are no phase deltas.

Workflow run

Comment /bench to run the lightweight benchmark (this comment) again on the latest commit, or /bench full to also run the integration-heavy benchmark, which posts in its own comment.

github-actions[bot]

This comment was marked as resolved.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

CLI reference prose guidance: snapshot supabase/supabase@a2e41ea supplied to reviewers (advisory, not a style pass).

Only Codex’s independent review was available because Claude’s pass did not complete. The PR fixes ACL filtering when an excluded name appears only in a function signature or as a grantee. Both dump paths still omit ACLs for foreign data wrappers whose names match excluded schemas, an issue present before this PR. The diff changes no CLI reference prose and shows no fundamental conflict with the pending work on next.

Findings

Severity Location Category Sources Claim
🟡 MINOR apps/cli/src/command-internal/pg-dump.run.ts:314 correctness codex Schema dumps still omit grants and revokes for foreign data wrappers whose names match excluded schemas, so a restore can leave the wrapper with different privileges.

Stats

Claude findings: 0 · Codex findings: 1 · Confirmed: 1 · Refuted: 0 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.2-sol · Trigger: auto · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

db dump drops GRANT and REVOKE lines for functions whose arguments use a type from an excluded schema (e.g. extensions.vector)

1 participant