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

supabase / cli / 27197280116
65%

Build:
DEFAULT BRANCH: develop
Ran 09 Jun 2026 09:37AM UTC
Jobs 1
Files 223
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

09 Jun 2026 09:35AM UTC coverage: 64.303% (-0.003%) from 64.306%
27197280116

push

github

web-flow
feat(cli): set up platform baseline before declarative apply (#5515)

Refs CLI-1601 —
https://linear.app/supabase/issue/CLI-1601/support-auth-dependencies-in-shadow-db-migrations

Provision the Supabase platform schema (auth, storage, realtime, etc.)
on shadow databases before applying declarative schemas, ensuring
Supabase-managed dependencies resolve correctly during both declarative
apply and cache warmup.

## Changes

- **New `SetupShadowDatabase` function** in `diff.go`: Provisions the
platform baseline on a freshly created shadow database without applying
user migrations. This allows declarative apply to share the same
starting point as migration-based workflows.

- **Refactored shadow setup logic**: Extracted common platform baseline
setup into `setupShadowConn` helper, used by both `SetupShadowDatabase`
and `MigrateShadowDatabase` to avoid duplication.

- **Updated declarative apply flow**:
- `Generate` now calls `setupShadowDatabase` when reusing the baseline
shadow for cache warmup
- `getDeclarativeCatalogRef` calls `setupShadowDatabase` before applying
declarative schemas
- This ensures platform objects (auth.sessions, auth.jwt(), etc.) are
available during schema application and cancel out of diffs

- **Added tests**: `TestSetupShadowDatabase` validates that the function
sets up the platform baseline without applying migrations, and the
`Generate` reuse test asserts the baseline is set up before declarative
apply.

## Note on baseline caching

A persistent "replayable SQL" baseline cache (so services don't boot on
cold runs) was considered and intentionally not pursued — the
`supabase/postgres` image pre-bakes part of the `auth` schema (overlap
on replay), a full `pg_dumpall` replay is fragile
(extensions/`shared_preload_libraries`/pgsodium/roles), and a
pg-delta-derived baseline currently drops grants. See CLI-1601 for the
full rationale.

https://claude.ai/code/session_01ACrX8NXcsYLENnCRXAub3S

Co-authored-by: Claude <noreply@anthropic.com>

10403 of 16178 relevant lines covered (64.3%)

7.07 hits per line

Coverage Regressions

Lines Coverage ∆ File
133
42.8
-0.3% internal/db/declarative/declarative.go
27
56.28
1.74% internal/db/diff/diff.go
Jobs
ID Job ID Ran Files Coverage
1 27197280116.1 09 Jun 2026 09:37AM UTC 223
64.3
GitHub Action Run
Source Files on build 27197280116
  • Tree
  • List 223
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #27197280116
  • 0e062554 on github
  • Prev Build on develop (#27192356801)
  • Next Build on develop (#27200095421)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc