wu-sheng opened a new pull request, #55:
URL: https://github.com/apache/skywalking-horizon-ui/pull/55
## Why
A structural runtime-rule apply is no longer synchronous on OAP. `POST
/runtime/rule/addOrUpdate` for a schema-changing edit now returns `200
structural_applied` + an `applyId` at phase `FENCING` ("accepted, not yet
durable"); the fence → persist → commit → resume tail runs in the background
and the real outcome is learned by polling `GET /runtime/rule/status`. The
previous UI marked the save "done" on the POST response (via a timeout-driven
`submitted` + poll-by-reread), which no longer reflects reality.
## What
Rework the DSL editor to the new async apply contract:
- **Phase stepper** for structural applies — `Compiled → Confirming across
the cluster → Committing → Done`, driven by polling `/runtime/rule/status` by
`applyId`. Body/filter-only edits stay instant (no stepper).
- **Terminal states**: `APPLIED` (success), `DEGRADED` (committed + durable
but cluster propagation unconfirmed — shows the laggard nodes, self-converges;
a warning, not an error), `FAILED` (rolled back; editor keeps your buffer to
fix). `compile_failed` renders as an inline diagnostic.
- **Force re-apply (recover)** on a DEGRADED/FAILED apply — re-runs the
apply to re-confirm the schema / un-stick a node, behind a confirm that notes
it briefly pauses collection.
- **Refresh resilience** — the `applyId` lives in the URL only while
in-flight, so a reload resumes the stepper; once terminal it resolves from the
durable row (a DEGRADED reads back as applied-from-stored-state).
- **Revert to bundled** is also a schema change, so it now runs the same
async stepper, and reverting an ACTIVE rule auto-inactivates first (one action).
New plumbing: api-client `ApplyPhase` + `RuleStatusResponse` + `applyId` on
`ApplyResult` + `RuntimeRuleClient.status()`; BFF `GET /api/rule/status`
passthrough (relays `applyId`); the `submitted`-timeout fallback narrowed to
the one path that can still need it. New operator doc
`docs/operate/runtime-rules.md`; CHANGELOG entry; all new strings translated
across the 8 locales.
## Validation
- type-check (vue-tsc + tsc) · UI build · BFF build · lint · 232 unit tests
· license headers — all green.
- Translations: all 8 catalogs complete (no `en.json` key missing).
- **Live OAP**: validated full-stack against a local BanyanDB-backed OAP
through the BFF — structural apply → `applyId` → `/status` `APPLIED`;
`no_change` and `inactivate` sync paths; revert → `applyId` → `APPLIED`; OAP
restored clean afterward. (Single-node OAP confirms the fence instantly, so
`FENCING`/`ROLLING_OUT`/`DEGRADED` linger only on a multi-node cluster.)
## Note — paired OAP change
The revert-to-bundled `applyId` path depends on a backend change that makes
`/delete?mode=revertToBundled` async (returns `reverted_to_bundled` + `applyId`
and runs the revert on the background executor). The UI degrades gracefully on
an OAP without it (revert falls back to the prior synchronous handling), but
the stepper for revert needs that OAP build.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]