openova/tests/e2e/sovereign-routing
hatiyildiz a35da929f1 feat(sovereign-route): values-driven /sovereign + /api/v1 routing
Per docs/INVIOLABLE-PRINCIPLES.md #4 (never hardcode), the catalyst-ui
nginx config now flows from values.yaml at chart-render time:

- routing.basePath (/sovereign) — also drives ingress strip-prefix
- routing.catalystApi.serviceDNS — in-cluster reverse-proxy target
- routing.catalystApi.port — upstream port
- dns.resolverIP — CoreDNS for proxy-time resolution (avoids stale
  ClusterIP after catalyst-api restarts)
- ingress.host / ingress.priority / ingress.className

Files:
- products/catalyst/chart/values.yaml — new, documents every default
- products/catalyst/chart/templates/ui-configmap.yaml — new, nginx
  reverse-proxies /api/* to catalyst-api Service DNS
- products/catalyst/chart/templates/ui-deployment.yaml — mounts the
  ConfigMap at /etc/nginx/conf.d/default.conf
- products/catalyst/chart/templates/ingress.yaml — values-driven host
  + path + priority + class
- tests/e2e/sovereign-routing/* — Playwright smoke for the routing

Captured from stalled agent /tmp/agent-sovereign-route-finish — agent
stream watchdog timed out after the work was authored but before commit.
2026-04-28 19:48:40 +02:00
..
package.json feat(sovereign-route): values-driven /sovereign + /api/v1 routing 2026-04-28 19:48:40 +02:00
playwright.config.ts feat(sovereign-route): values-driven /sovereign + /api/v1 routing 2026-04-28 19:48:40 +02:00
README.md feat(sovereign-route): values-driven /sovereign + /api/v1 routing 2026-04-28 19:48:40 +02:00
sovereign-routing.spec.ts feat(sovereign-route): values-driven /sovereign + /api/v1 routing 2026-04-28 19:48:40 +02:00

Sovereign wizard routing smoke test

Closes #142.

Verifies that the chart-rendered routing for https://console.openova.io/sovereign/ wires together end-to-end:

  1. GET /sovereign/ returns the wizard SPA shell (200, HTML).
  2. SPA fallback works — GET /sovereign/wizard/credentials also returns the shell so the wizard's React-Router can take over client-side.
  3. POST /sovereign/api/v1/subdomains/check round-trips through Traefik's strip-sovereign middleware → catalyst-ui nginx /api/ reverse-proxy → catalyst-api Service (DNS sourced from values.routing.catalystApi.serviceDNS, never hardcoded — see docs/INVIOLABLE-PRINCIPLES.md §4).

Run modes

Mock (CI default, no cluster needed)

cd tests/e2e/sovereign-routing
npm install
npx playwright install chromium
USE_MOCK=1 npm test

USE_MOCK=1 intercepts every network call with canned responses that mirror the real chart-rendered nginx + catalyst-api behaviour. Fast, deterministic, and proves the SPA's wiring (basename, API_BASE) without depending on a deployed environment.

Live cluster (post-Group-C cutover)

SOVEREIGN_BASE_URL=https://console.openova.io \
SOVEREIGN_BASE_PATH=/sovereign \
  npx playwright test

Or against a Sovereign:

SOVEREIGN_BASE_URL=https://console.omantel.omani.works \
  npx playwright test

URLs flow from env vars per the never-hardcode rule. The defaults match the chart's values.yaml (ingress.host + routing.basePath).