Brings PR #148 — two pre-existing CI fixes (network_diagrams JSONB
server_default, removed deprecated session-scoped event_loop fixture).
The conftest.py event_loop fix on main is already incorporated in
FlowPilot's b14a16a (RLS-gating commit, which dropped the same fixture
as part of its larger refactor). Kept HEAD's version of the RLS-gating
collection hook; the event_loop fixture removal is identical.
The network_diagram.py fix lands cleanly via auto-merge.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1. backend/app/models/network_diagram.py — `nodes` and `edges` columns
used `server_default="'[]'"` (a Python string), which SQLAlchemy
wraps in single quotes when generating DDL, producing
`JSONB DEFAULT '''[]'''` — invalid JSON. Switch to
`server_default=text("'[]'::jsonb")` so the literal is passed through
and the table can actually be created. Surfaced on every CI run as
`asyncpg.exceptions.InvalidTextRepresentationError: invalid input
syntax for type json` at fixture setup time, cascading hundreds of
test errors.
2. backend/tests/conftest.py — drop the deprecated session-scoped
`event_loop` fixture. Since pytest-asyncio 0.23+, the plugin manages
the loop itself; redefining it with a session scope but never
`set_event_loop()`-ing it left the loop dangling, so any test that
called `asyncio.run()` (e.g. `test_tasks_are_isolated`) closed the
process loop and broke the next async test in the module —
`test_require_tenant_context_raises_403_when_no_account` was the
visible casualty in the CI logs.
Verified locally:
- `pytest tests/test_uploads.py::test_upload_success` — was setup-error
on `network_diagrams` DDL; now passes.
- `pytest tests/test_tenant_context.py` — was 1 fail / 3 pass; now 4/4.
Both are real bugs, not test infrastructure churn. Pre-existing on
main; not introduced here.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>