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

supabase / cli / 26816495140
64%

Build:
DEFAULT BRANCH: develop
Ran 02 Jun 2026 11:25AM UTC
Jobs 1
Files 219
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

02 Jun 2026 11:23AM UTC coverage: 63.925% (+0.02%) from 63.905%
26816495140

push

github

web-flow
fix(cli): bind a free port for edge-runtime diff containers (#5424)

## What changed

The schema diff path (`supabase db pull` and friends) executes one-shot
scripts — migra, pg-delta, pgcache — by running `edge-runtime start
--main-service=.` inside a container. Both call sites
(`RunEdgeRuntimeScript` in `internal/utils/edgeruntime.go` and
`diffWithStream` in `internal/db/diff/diff.go`) launched it with
`NetworkMode: host` but **without** a `--port` flag.

`edge-runtime start` is an HTTP server and always binds a TCP listener.
With no explicit port it bound the edge-runtime **default** port, and
with host networking that bind landed directly in the host (Docker VM)
network namespace. When the port was already taken — a leftover diff
container from an interrupted run, the local stack, or anything else on
that port — the bind failed and the container exited 1.

This change adds a shared `EdgeRuntimeStartCmd` helper that allocates a
free host port and passes it as `--port`, used by both call sites, so
concurrent or leftover one-shot containers no longer contend for the
default port. On the rare port-allocation failure it falls back to the
previous portless command.

## Why

Reported in #5407: `supabase db pull` on Windows fails at "Diffing
schemas..." with `Error: Address already in use (os error 98)`. Host
networking on Docker Desktop (Windows/macOS) shares the VM namespace and
makes the default-port collision far more likely. `functions serve` was
never affected because it already passes an explicit `--port`
(`serve.go:190`).

## Reviewer notes

- Covers all diff engines that go through `RunEdgeRuntimeScript`: migra,
pg-delta (×3), pgcache, apply — plus the streaming `diffWithStream`.
- With Docker Desktop host networking the port is probed on the real
host while the bind happens in the VM namespace, so a probed-free port
isn't strictly guaranteed free in the VM. Moving off the single shared
default to a random ephemeral port removes virtually all rea... (continued)

10095 of 15792 relevant lines covered (63.92%)

7.1 hits per line

Coverage Regressions

Lines Coverage ∆ File
3
90.7
-2.41% internal/utils/edgeruntime.go
Jobs
ID Job ID Ran Files Coverage
1 26816495140.1 02 Jun 2026 11:25AM UTC 219
63.92
GitHub Action Run
Source Files on build 26816495140
  • Tree
  • List 219
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #26816495140
  • 83e5b943 on github
  • Prev Build on develop (#26812978007)
  • Next Build on develop (#26829367591)
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