• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / cli / 32144633196
62%
develop: 62%

Build:
Build:
LAST BUILD BRANCH: gh-readonly-queue/develop/pr-6275-dc97151e51eca112de94c5b9bfe102ee798b7caf
DEFAULT BRANCH: develop
Ran 18 Aug 2026 01:51PM UTC
Jobs 1
Files 95
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

18 Aug 2026 01:49PM UTC coverage: 62.406%. Remained the same
32144633196

push

github

web-flow
fix(cli): restore postgres after role reverts (CLI-2205) (#6246)

## TL;DR

Passwordless `db push --linked` breaks on any migration containing
`reset role`:
the login role path relies on a session level `SET SESSION ROLE
postgres` that the migration itself undoes.
File runners now re-assert the step-down immediately after each
role-reverting statement, at the end of each file, and before every CLI
owned ledger write, so the whole file behaves the same on both auth
paths.

## whats biting?

The passwordless path connects as a temp `cli_login_*` role and steps
down to `postgres` once at connect. A migration's `reset role` reverts
the session to the login role, so:

- the appended history insert fails with `permission denied for schema
supabase_migrations (SQLSTATE 42501)` and rolls the migration back, even
though every user statement succeeded
- authored transaction and pg-delta no-transaction files commit their
statements but never record, so the next push re-applies them
- statements between the `reset role` and the end of the same file run
as the login role, so `granted by current_user` cleanup silently no-ops
while the push exits 0 (reproduced on staging: the stale
`pg_auth_members` grant survives)
- later files and the `seed_files` upsert run as the login role too

## fixed now by:

- `LegacyDbSession.restoreRoleSql` (set only when the step-down ran) is
injected by every file runner right after each top-level role revert
(`RESET ROLE`, `SET [SESSION] ROLE [TO|=] NONE|DEFAULT` including a
case-sensitively quoted `'none'`, `RESET SESSION AUTHORIZATION`, `SET
SESSION AUTHORIZATION DEFAULT`, `DISCARD ALL`), and again at end of file
and before the history insert and both `seed_files` upserts, so
`current_user` matches a password session for the whole file
- injected restores never shift `At statement: N` and are never recorded
in the history row; deliberate `set role <x>` choreography is untouched,
and password, local and plain `--db-url` sessions see a... (continued)

5571 of 8927 relevant lines covered (62.41%)

6.65 hits per line

Jobs
ID Job ID Ran Files Coverage
1 32144633196.1 18 Aug 2026 01:51PM UTC 95
62.41
GitHub Action Run
Source Files on build 32144633196
  • Tree
  • List 95
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #32144633196
  • 0c721790 on github
  • Prev Build on gh-readonly-queue/develop/pr-6248-c8f82350aece6b77920b88d1ba226315de87ee5b (#32142975677)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc