Skip to content

refactor: remove the routing plane UI except the llama target form - #7

Merged
Sebas1705 merged 1 commit into
mainfrom
refactor/remove-routing-plane
Nov 12, 2026
Merged

Sebas1705 merged 1 commit into
mainfrom
refactor/remove-routing-plane

Conversation

@Sebas1705

Copy link
Copy Markdown
Contributor

Why

Finding F3/F8 of the architecture review: the "point the AI engine somewhere else" capability is implemented in several overlapping places. The owner wants to keep only the llama target in ai-engine. This is the Backoffice half; the BFF half is AxiomNode/bff-backoffice#9 (same branch name). ai-engine has nothing dead, so it gets no PR.

Stacking and overlap with open PRs

Stacked on #6 (perf/phase2-frontend), so the base of this PR is that branch. #6 moved the label dictionaries into i18n/dictionaries/*.ts and edits AIDiagnosticsPanel.tsx and two of the test files I rewrite; branching from main would conflict on every label removal. Merge #6 first, then retarget this PR to main. #3 (fix/replace-public-ip-fixtures) only changes IP fixtures in service-overview-panel.integration.test.tsx and src/.env.example; the tests it touches are rewritten here (no public IPs remain in them), so closing or rebasing #3 is trivial. #4 and #5 do not touch these files.

Inventory of the routing plane in the UI (before this PR)

LOC are physical lines on the base branch.

Item Where LOC BFF route it calls Needed by the llama target? Action
Kubernetes tab of the overview (KPI cards, cluster/nodes/workloads/top pods, 7 formatters) + fetchKubernetesOverview + KubernetesOverview type ServiceOverviewPanel.tsx (about 230 of its 841 lines), operationalSummary.ts (75) ~305 GET /v1/backoffice/kubernetes/overview, fetched on mount and on every auto-refresh tick even with the tab hidden No removed. It is the only consumer of that route in all clones (Mobile-App and bff-mobile do not call /v1/backoffice/*)
Saved presets selector, create/save/delete/activate preset flows, preset matching (findPresetMatch), AiEngineTargetPreset type useAiEngineTargetState.ts (524 LOC hook), AiEngineTargetControl.tsx (339 LOC), domain/types/backoffice.ts ~330 of those GET/POST /ai-engine/presets, PUT/DELETE /ai-engine/presets/:id No removed
Routing history labels overview.routingHistory.* (no view used them) i18n/labels.ts + 4 dictionaries ~17 per language none (the BFF route was not reachable through the gateway) No removed
Label keys for presets (*.selector, *.optionsCount, *.newBtn/addBtn/saveBtn/deleteBtn, diag.target.*Preset*, ...) 5 dictionaries 37 en, 37 es, 10 de, 17 fr, 10 it - No removed
Llama target card: reads the effective target, probes /ai-engine/probe, applies with PUT /ai-engine/target (probe first), resets with DELETE /ai-engine/target, broadcast refresh between panels useAiEngineTargetState.ts, AiEngineTargetControl.tsx, used by ServiceOverviewPanel and AIDiagnosticsPanel rewritten, 524 -> 326 and 339 -> 255 GET/PUT/DELETE /ai-engine/target, POST /ai-engine/probe Yes kept, simplified to label/host/protocol/port form + probe/apply/reset
Service overview operational summary, generation spotlight, AI diagnostics, service consoles, role management - - - - untouched

Behaviour change to be aware of: the card no longer has a saved-destination dropdown; the operator types host/protocol/port (and an optional label). The overview card now also has the "reset to environment target" button that only the AI diagnostics card had. Existing saved presets in the BFF state file are simply ignored.

Result

  • 14 files, +426 / -1,499 lines. Net by area: production code -641, tests -314, i18n dictionaries -117 (5 files), docs -1. ServiceOverviewPanel.tsx goes from 841 to 597 lines.
  • Bundle (vite build, raw / gzip kB): total 749.8 / 191.9 -> 728.9 / 187.7 (-21.0 / -4.2). ServiceOverviewPanel chunk 25.09 / 5.96 -> 15.66 / 4.43, useAiEngineTargetState chunk 14.35 / 4.16 -> 10.20 / 3.16, entry chunk 212.93 / 66.30 -> 210.71 / 65.78, es 31.24 / 8.86 -> 29.03 / 8.38.
  • The overview no longer makes the extra kubernetes/overview request every refresh cycle (it was 1 BFF call fanning out to 6 Kubernetes API calls).

Verification

  • npm run build (tsc -b + vite build) green; vitest run --coverage: 19 files, 154 tests green; coverage 93.56% statements, 85.9% branches (gate 85), 95.59% functions, 94.31% lines (gates 90/85/90/90).
  • Tests rewritten: the overview tests now cover the form-only target card (probe, apply, https fallback port for an out-of-range port, reset, probe-blocked apply, error paths for refresh/apply/reset, legacy and malformed payloads) and assert that no Kubernetes tab or kubernetes request exists and that /ai-engine/presets is never called.
  • Used the existing node_modules (no npm ci); the project has no lint script.
  • Not verified: I did not run the app in a browser against a live BFF (the UI was checked only through the jsdom integration tests and the production build), and the de/fr/it strings I changed are plain translations without native review. Nothing was deployed.

Depends on / ordering

The routes this UI stopped calling are removed in AxiomNode/bff-backoffice#9. This PR is safe to merge before or after it: the remaining UI only calls GET/PUT/DELETE /v1/backoffice/ai-engine/target and POST /v1/backoffice/ai-engine/probe, which both PRs keep. The api-gateway proxy routes for the removed endpoints become dead (list in #9).

Base automatically changed from perf/phase2-frontend to main November 12, 2026 18:15
Drop the Kubernetes overview tab and its cluster fetch on every refresh, the saved ai-engine presets/connections selector and the unused routing history labels. The llama target control now only reads, probes, applies and resets the target.
@Sebas1705
Sebas1705 force-pushed the refactor/remove-routing-plane branch from 7453f77 to f2e6c9e Compare November 12, 2026 19:23
@Sebas1705
Sebas1705 marked this pull request as ready for review November 12, 2026 19:23
@Sebas1705
Sebas1705 merged commit 9ff8861 into main Nov 12, 2026
6 checks passed
@Sebas1705
Sebas1705 deleted the refactor/remove-routing-plane branch November 12, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant