davsclaus opened a new pull request, #29393:
URL: https://github.com/apache/camel/pull/29393

   ## Description
   
   [CAMEL-26723](https://issues.apache.org/jira/browse/CAMEL-26723): W-5 of the 
stage 2 decisions on CAMEL-26607, make a chaos rule of a real error.
   
   **Stacked on #29392** (base `CAMEL-26722-chaos-scenarios`); retarget to main 
once that is merged.
   
   On the Errors tab of the Camel TUI, `!` on a real error opens the Chaos 
screen with a rule that makes the same error again, typed in so it can be 
changed before Enter, and added after the usual confirmation:
   
   - the same exception and message at the step it happened at (else its 
endpoint, else its route):
     `step=callStock error exception=java.net.ConnectException 
message="Connection refused" until=10`
   - an HTTP failure (`HttpOperationFailedException` with a status code): the 
same status at the same endpoint in the same route, as `status=` fires at the 
sends of an endpoint:
     `endpoint=http://localhost:8765/stock in=orders error status=503 until=10`
   - `until=10`, so it stops by itself. The message is put on one line, without 
double quotes, at most 120 characters.
   - Only when chaos is on in the integration, and not for an error that a 
chaos rule made (marked 🎲). The footer shows `! chaos rule of it` when it works.
   
   Why: you fix the bug, and then prove the fix against the same failure 
without waiting for it to happen again (and can keep the rule in a scenario, 
`s` on the chaos screen).
   
   Code: `ChaosFromError` builds the rule; `ErrorsTab.handleErrorActionKey` 
(Shift+F8 and `!`, kept apart so `handleTabKeyEvent` stays under the size cap); 
`MonitorContext.chaosRule` and `ChaosControl.openRule` open the Chaos screen 
with the rule typed in.
   
   Docs: the Errors and chaos help pages, the TUI page (Troubleshooting Errors 
and Chaos), and the camel-chaos Scenarios section.
   
   ## Tests
   
   - `ChaosFromErrorTest`: the rule for an exception at a step, a long message 
with quotes and new lines, no message, an HTTP status (from the message and 
from the endpoint of the error), the endpoint and route fallbacks, not enough 
to make a rule; the Errors tab opens the Chaos screen with it, not for a 
chaos-made error nor with chaos off.
   - `ChaosControlTest`: a rule opened typed in is added after the confirmation.
   - TUI chaos, errors, help and size tests: 165 green.
   - The rules it makes parse in camel-chaos (checked with a throwaway test): 
`fail every run of step callStock with ConnectException "Connection refused", 
for the next 10 runs`, `fail every send to http://localhost:8765/stock in route 
orders with HTTP status 503, for the next 10 sends`.
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 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]

Reply via email to