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

firezone / firezone / 23660203923
67%

Build:
DEFAULT BRANCH: main
Ran 27 Mar 2026 05:57PM UTC
Jobs 6
Files 651
Run time 2min
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

27 Mar 2026 05:55PM UTC coverage: 67.202% (+0.09%) from 67.109%
23660203923

push

github

web-flow
refactor(portal): replace node type with dynamic pools (#12668)

## Summary

Removes `NODE_TYPE` and `BACKGROUND_JOBS_ENABLED` environment variables
("node coloring"), collapsing all node types into a single type. This
lets us run fewer VMs and reduce unnecessary cluster size — every node
now runs everything instead of needing separate web, API, and worker
nodes.

Since all processes now share the same VM, we introduce **two isolated
DB connection pools** to prevent noisy-neighbor effects between web and
API workloads:

- **Web** (`Portal.Repo.Web` / `Portal.Repo.Replica.Web`) — PortalWeb
HTTP requests and LiveViews
- **Api** (`Portal.Repo.Api` / `Portal.Repo.Replica.Api`) — PortalAPI
REST endpoints and channel/socket connections

Oban workers use the default `Portal.Repo` / `Portal.Repo.Replica` pool
— no separate Job pool needed.

Each pool has independent primary and replica repos (4 total), with
configurable pool sizes via new env vars.

### How pool routing works

Pool selection happens at process boundaries via `put_dynamic_repo/1`:

| Boundary | Mechanism | Pool |
|---|---|---|
| PortalWeb HTTP requests | `PortalWeb.Plugs.PutDynamicRepo` plug | Web
|
| PortalWeb LiveViews | `PortalWeb.LiveHooks.PutDynamicRepo` on_mount
hook | Web |
| PortalAPI HTTP requests | `PortalAPI.Plugs.PutDynamicRepo` plug | Api
|
| PortalAPI sockets | `connect/3` in each socket module | Api |
| Oban workers | (none — uses default `Portal.Repo`) | Default |

All DB access goes through `Portal.Safe` → `Portal.Repo` → Ecto's
`get_dynamic_repo/0`, which transparently dispatches to whichever pool
was set for the current process.

### Process hierarchy inheritance

Child processes (channel servers, tasks, GenServers) automatically
inherit their parent's pool via an overridden `get_dynamic_repo/0` on
`Portal.Repo` and `Portal.Repo.Replica`. This walks `$callers` and
`$ancestors` using `:erlang.process_info(pid, :dictionary)` to find the
parent's dynamic repo setting, then cach... (continued)

43 of 63 new or added lines in 15 files covered. (68.25%)

1 existing line in 1 file now uncovered.

35870 of 53376 relevant lines covered (67.2%)

473515.24 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
3.79
-0.06% elixir/lib/portal/config/definitions.ex
2
0.0
0.0% elixir/.credo/check/warning/unsafe_repo_usage.ex
2
90.8
-2.05% elixir/lib/portal_api/client/socket.ex
2
89.55
-2.64% elixir/lib/portal_api/gateway/socket.ex
2
60.0
elixir/lib/portal_api/plugs/put_dynamic_repo.ex
2
93.75
-6.25% elixir/lib/portal_api/relay/socket.ex
2
33.33
elixir/lib/portal_web/live_hooks/put_dynamic_repo.ex
2
60.0
elixir/lib/portal_web/plugs/put_dynamic_repo.ex
1
49.47
0.0% elixir/lib/portal/telemetry.ex
1
90.54
0.0% elixir/lib/portal_web/router.ex

Coverage Regressions

Lines Coverage ∆ File
1
84.84
-0.13% rust/relay/server/src/server.rs
Subprojects
ID Flag name Job ID Ran Files Coverage
1 swift-test 23660203923.1 27 Mar 2026 05:57PM UTC 44
15.67
GitHub Action Run
2 rust-tunnel-test 23660203923.2 27 Mar 2026 06:12PM UTC 119
48.73
GitHub Action Run
3 rust-test-Windows 23660203923.3 27 Mar 2026 06:06PM UTC 171
58.87
GitHub Action Run
4 rust-test-Linux 23660203923.4 27 Mar 2026 06:01PM UTC 197
56.45
GitHub Action Run
5 rust-test-macOS 23660203923.5 27 Mar 2026 06:00PM UTC 151
58.6
GitHub Action Run
6 portal 23660203923.6 27 Mar 2026 05:59PM UTC 387
79.1
GitHub Action Run
Source Files on build 23660203923
  • Tree
  • List 651
  • Changed 27
  • Source Changed 13
  • Coverage Changed 27
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23660203923
  • 318be2d2 on github
  • Prev Build on main (#23653931042)
  • Next Build on main (#23701535351)
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