davsclaus opened a new pull request, #29348: URL: https://github.com/apache/camel/pull/29348
_Claude Code on behalf of Claus Ibsen_ [CAMEL-26695](https://issues.apache.org/jira/browse/CAMEL-26695), step 3a: chaos from where you look. **Stacked on #29347** (step 2, the known rules), which is stacked on #29346 (step 1, the actions). Retarget as they merge. The 🎲 marks on faulted exchanges (the rest of step 3) come in a separate PR.  *Live: `!` on the `to` `callStock` of route `orders` on the Diagram. The Chaos screen opens with the known rules for its HTTP endpoint and its step, and "Returns an error (HTTP status)" has the endpoint filled in.* ### `!` on three screens | Where | Target | Known rules offered | |---|---|---| | A node of the Diagram (route view) | a `to`: its step, and the endpoint it sends to (the `uri` of the node in the route model) | the endpoint's faults (an HTTP status only for an HTTP endpoint), and the step's | | | the `from`: the route, and its endpoint when the route polls | the route's faults, and the poll faults when it polls | | | in the topology view: the selected route | the route's faults, and the poll faults when it polls | | The Endpoint tab | an endpoint the routes send to | that endpoint's faults | | | an endpoint a route consumes | the route's faults, and the poll faults when it polls | | The Consumers tab | the consumer's route, and its endpoint when it polls on a schedule | the route's faults, and the poll faults when it polls | - **Which rules:** a recipe is offered when the target fills in every one of its placeholders that names an endpoint (with the placeholder's schemes), a polled endpoint, a route or a step. Those placeholders start with the target's value. The title says where: "Add a chaos rule to chaosdemo at to callStock (http://localhost:8765/stock)". - **No known rule fits:** "Write the rule yourself" starts the typed line with the target (`endpoint=…`, `step=…`, `route=…`). If no recipe fits the target at all, the typed line opens directly. - **When it works:** only when chaos is on in the integration. The footer of those screens shows `! chaos` then. ### Code - `ChaosHere`: the target (`Target`), built from an endpoint, a consumer or a diagram node, plus the `!` key and footer hint for the three tabs. - `ChaosRecipeForm` takes a target: it filters and prefills the recipes. `ChaosControl.openAt` opens it. - `MonitorContext.chaosHere` opens the Chaos tab with the target. TabRegistry wires it next to SQL Trace → SQL Query, now in their own method, `wireCrossTabActions`, which keeps `initTabs` under the size limit. - The Endpoint, Consumers and Diagram tabs each gain the key, the footer hint, and a small helper for the selected row or node. ### Tests - New `ChaosHereTest` (5): - the targets of an endpoint (sent to / consumed and polled), a consumer, and a diagram `to` (its step, and the endpoint from the node's uri or the producer) and `from`; - the recipes per target, e.g. an HTTP status for an HTTP endpoint but not for seda, and route rules for a route; - `!` on the Endpoint tab calling the callback with the endpoint, and doing nothing without chaos; - the form opened at a route through to the request; - the typed line starting with the target. - The whole camel-jbang-plugin-tui suite: 2320 tests pass (1 skipped), `SourceSizeTest` included. - Live, a scratch TUI on the packaged plugin, against `camel run --chaos`: the screenshot above. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_012nJsFsjqqFiwroeHRWaKbS -- 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]
