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

supabase / supavisor / 39951659296
83%

Build:
DEFAULT BRANCH: main
Ran 23 Oct 2026 12:23PM UTC
Jobs 2
Files 147
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

23 Oct 2026 12:12PM UTC coverage: 82.192% (-0.006%) from 82.198%
39951659296

push

github

web-flow
List tenant's pools (#1237)

# List a tenant's pools

Adds a Supavisor API to list all pools of a tenant across the cluster.
Killing a pool (DELETE) is a follow-up PR.

## What's included

- **`GET /api/tenants/:external_id/pools`** — lists every pool of a
tenant across all
nodes. Per pool: id fields, an opaque `token`, node, upstream host/port,
connected
  client count, and backend connection counts (idle / checked_out).
- **`Supavisor.Ops`** — transport-agnostic domain layer: `list_pools/1`
fans out via
`:erpc` (tolerating unreachable nodes), `list_pools_local/1` reads the
per-node
  registries. `Supavisor.Manager.client_count/1` added.
- **`SupavisorWeb.PoolId`** — external representation: `id_to_map/1`
plus a reversible,
opaque `encode_token/1` / `decode_token/1` (validated via an embedded
`Ecto.Schema`)
  that the client echoes back to target a pool in the kill endpoint.

## API

```
GET /api/tenants/:external_id/pools
Authorization: Bearer <api jwt>
```

```json
{
  "pools": [
    {
      "id": {"type":"single","tenant":"dev_tenant","user":"postgres","mode":"transaction",
             "database":"postgres","search_path":null,"upstream_tls":false},
      "token": "eyJ0eXBlIjoic2luZ2xlIn0…",
      "node": "node1@127.0.0.1",
      "host": "localhost", "port": 6432,
      "clients": 1,
      "connections": {"idle": 1, "checked_out": 0}
    }
  ],
  "errors": {"node2@127.0.0.1": "unreachable"}
}
```

Partial-success: a node that fails to respond is reported under `errors`
as
`"unreachable"` (the real `:erpc` reason is logged server-side, not
returned);
the rest of the cluster's pools are still listed.

## Open question

Where should maintenance/ops endpoints live? We're going to add more
operator commands.
Options: a dedicated `OpsController` (+ `/api/ops/...` path
and/or a dedicated, swappable auth pipeline) vs. keeping them in
`PoolController`/`:api`.
The domain lives in `Supavisor.Ops`, so re-homing the endpoints later is
cheap.
Current PR keeps t... (continued)

48 of 55 new or added lines in 6 files covered. (87.27%)

4 existing lines in 4 files now uncovered.

3374 of 4105 relevant lines covered (82.19%)

45060.37 hits per line

Uncovered Changes

Lines Coverage ∆ File
7
77.42
lib/supavisor/ops.ex

Coverage Regressions

Lines Coverage ∆ File
1
88.92
-0.28% lib/supavisor/client_handler.ex
1
91.67
0.0% lib/supavisor/terminator.ex
1
86.67
-6.67% lib/supavisor/monitoring/ranch.ex
1
76.92
-7.69% lib/supavisor/erl_sys_mon.ex
Jobs
ID Job ID Ran Files Coverage
1 run-tests - 39951659296.1 23 Oct 2026 12:25PM UTC 147
81.12
GitHub Action Run
2 run-integration - 39951659296.2 23 Oct 2026 12:23PM UTC 147
44.12
GitHub Action Run
Source Files on build 39951659296
  • Tree
  • List 147
  • Changed 11
  • Source Changed 5
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #39951659296
  • a518cf61 on github
  • Prev Build on main (#39779195814)
  • Next Build on main (#40039873189)
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