fix(#110): frontend-e2e uses Python 3.12 + fail-loud backend readiness #123

Merged
Mark merged 1 commit from fix/110-frontend-e2e-python312 into main 2026-09-11 17:54:43 +00:00
Owner

Resolves Mark/osint-hub#110 — frontend-e2e has never passed in PR CI (49 skipped, 32 cancelled, 1 fail).

Root cause:

  • Container was mcr.microsoft.com/playwright:v1.40.0-jammy (Ubuntu jammy → Python 3.10).
  • Backend uses PEP 695 generics in backend/app/services/llm/parsing.py:17 (def safe_parse_llm_json[T: BaseModel](...)), which require Python ≥ 3.12. The 3.10 runtime couldn't even import the backend, so uvicorn never started.
  • Even if it had, the Start backend server step did curl ... || echo "Backend not ready yet" — a dead backend was silently tolerated, so every Playwright spec failed in 2–3 ms producing ~120 meaningless green-then-fail specs.

What this PR changes:

  1. Bumps container to mcr.microsoft.com/playwright:v1.49.0-noble (Ubuntu 24.04, Python 3.12.3 — verified locally). Also brings the bundled Playwright runtime closer to the frontend's @playwright/test ^1.58.2.
  2. Drops the apt-get install python3 python3-pip step (noble image already has 3.12) and replaces it with a python3 --version + sys.version_info >= (3,12) assertion so any future regression to a 3.10 image fails the step at runtime-check rather than at import time.
  3. Rewrites the Start backend server step:
    • setsid + disown so uvicorn survives past the step boundary (Playwright needs it running).
    • 60s readiness loop on /healthz.
    • On timeout or uvicorn-exit, emit ::error::, tail /tmp/uvicorn.log, exit 1.
    • No more || echo swallow.

What this PR does NOT change (per #110 scope):

  • Does not drop continue-on-error: true on the security/full-suite jobs (separate follow-up).
  • Does not close #110 — leaving that to the reviewer after they observe a green run.

Verification:

  • YAML parses cleanly (9 jobs intact).
  • setsid+disown detachment tested locally — server survives parent exit and continues serving HTTP.
  • Probe loop tested both paths: succeeds against a healthy server, fails (with log tail) against a dead server.

Workflow diff is +40/−9 in .forgejo/workflows/ci.yml. No code changes.

Resolves Mark/osint-hub#110 — frontend-e2e has never passed in PR CI (49 skipped, 32 cancelled, 1 fail). **Root cause:** - Container was `mcr.microsoft.com/playwright:v1.40.0-jammy` (Ubuntu jammy → Python 3.10). - Backend uses PEP 695 generics in `backend/app/services/llm/parsing.py:17` (`def safe_parse_llm_json[T: BaseModel](...)`), which require Python ≥ 3.12. The 3.10 runtime couldn't even import the backend, so uvicorn never started. - Even if it had, the `Start backend server` step did `curl ... || echo "Backend not ready yet"` — a dead backend was silently tolerated, so every Playwright spec failed in 2–3 ms producing ~120 meaningless green-then-fail specs. **What this PR changes:** 1. Bumps container to `mcr.microsoft.com/playwright:v1.49.0-noble` (Ubuntu 24.04, Python 3.12.3 — verified locally). Also brings the bundled Playwright runtime closer to the frontend's `@playwright/test ^1.58.2`. 2. Drops the `apt-get install python3 python3-pip` step (noble image already has 3.12) and replaces it with a `python3 --version` + `sys.version_info >= (3,12)` assertion so any future regression to a 3.10 image fails the step at runtime-check rather than at import time. 3. Rewrites the `Start backend server` step: - `setsid` + `disown` so uvicorn survives past the step boundary (Playwright needs it running). - 60s readiness loop on `/healthz`. - On timeout or uvicorn-exit, emit `::error::`, tail `/tmp/uvicorn.log`, `exit 1`. - No more `|| echo` swallow. **What this PR does NOT change (per #110 scope):** - Does not drop `continue-on-error: true` on the security/full-suite jobs (separate follow-up). - Does not close #110 — leaving that to the reviewer after they observe a green run. **Verification:** - YAML parses cleanly (9 jobs intact). - `setsid+disown` detachment tested locally — server survives parent exit and continues serving HTTP. - Probe loop tested both paths: succeeds against a healthy server, fails (with log tail) against a dead server. Workflow diff is +40/−9 in `.forgejo/workflows/ci.yml`. No code changes.
fix(#110): frontend-e2e uses Python 3.12 + fail-loud backend readiness
Some checks failed
CI / Frontend Lint (pull_request) Failing after 22s
CI / Frontend Tests (pull_request) Has been skipped
Performance Regression Tests / Performance Regression Detection (pull_request) Failing after 6s
Stress Tests / Stress & Pipeline Tests (pull_request) Failing after 6s
Stress Tests / Full Data Pipeline Validation (pull_request) Has been skipped
CI / Backend Lint & Format (pull_request) Failing after 45s
CI / Golden Fixture Validation (pull_request) Has been skipped
CI / Backend Tests (pull_request) Has been skipped
CI / Backend Security Tests (pull_request) Has been skipped
CI / Dependency Security Scan (pull_request) Has been skipped
Performance Regression Tests / Compare with Baseline (pull_request) Has been skipped
CI / Frontend E2E Tests (pull_request) Has been skipped
CI / All Checks Passed (pull_request) Failing after 1s
3620da5a76
Bump the frontend-e2e container from mcr.microsoft.com/playwright:v1.40.0-jammy
(Ubuntu jammy / Python 3.10) to mcr.microsoft.com/playwright:v1.49.0-noble
(Ubuntu noble / Python 3.12.3). The backend uses PEP 695 generics in
backend/app/services/llm/parsing.py (def safe_parse_llm_json[T: BaseModel](...))
which require Python >=3.12; the jammy image's 3.10 cannot import the backend,
so uvicorn never starts.

Also rewrite the Start backend server step:
- setsid+disown so uvicorn survives past the step boundary (the next step,
  Playwright, needs the backend to be running).
- Loop /healthz up to 60s; on timeout OR uvicorn-exit, emit a ::error:: line
  and tail the uvicorn log, then exit 1. Replaces the previous
  'curl ... || echo "Backend not ready yet"' swallow that masked every
  backend crash and produced ~120 meaningless Playwright failures.

Drop the apt-get python3 install step — the noble image already ships 3.12.
Replace it with an explicit version assertion so any future regression to a
3.10 image fails the step at the runtime-check rather than at import time.
Mark merged commit c5b75e1bce into main 2026-09-11 17:54:43 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/osint-hub!123
No description provided.