defang
defang copied to clipboard
add last 30 terminal outputs for tracking for errors on command
Description
When CLI errors occur we don't always have a good idea of why it happens as we do not have customer deployment information. By including the last 10 lines of their terminal output when an error occurs on a command or before the AI debugger prompt we can hope to get some context on why they have a failure.
This PR includes
- adding a circular buffer to the terminal to cache the last 10 terminal outputs
- ~~add the terminal output to tracking command events which has a failure~~
- ~~add the terminal output to tracking of when the debugger prompt~~
Linked Issues
fixes #2291
Checklist
- [X] I have performed a self-review of my code
- [X] I have added appropriate tests
- [ ] I have updated the Defang CLI docs and/or README to reflect my changes, if necessary
Update: This PR is on hold. As mentioned above the threading of the logCache and the size of some of the function signatures is cumbersome. Additionally, this may not be the best way to log build breaks for analysis.
Closing this for now