Skip to content

feat(telemetryx): report command panics to Argvio - #68

Open
emmanuelgautier wants to merge 1 commit into
mainfrom
feat/telemetryx-panic-capture
Open

emmanuelgautier wants to merge 1 commit into
mainfrom
feat/telemetryx-panic-capture

Conversation

@emmanuelgautier

Copy link
Copy Markdown
Member

Argvio currently captures no crashes: the Go SDK has no panic capture, and the CLIs wrap shutdown in a closure, so a panic in a command leaves nothing in Argvio even though every CLI's --sqa-opt-out help says it covers "crash reports".

Instrument now wraps every command's RunE (after cobrasdk.InstrumentCobra) with a recover that:

  • records the command as failed with exit code 2 and an error of category internal, reason panic (the panic value is never sent, it may hold user input),
  • flushes the Argvio client (the process is about to die, deferred shutdowns may not run),
  • re-panics with the original value, so output and exit code are unchanged.

Panics in goroutines a command starts are not seen. No CLI code change is needed beyond bumping x.

Test: TestInstrument_RecordsAPanicFlushesAndRepanics (fails without the change). go test -race ./... and golangci-lint pass.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.11%. Comparing base (2719d97) to head (036601d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #68      +/-   ##
==========================================
+ Coverage   89.86%   90.11%   +0.24%     
==========================================
  Files          11       11              
  Lines         612      627      +15     
==========================================
+ Hits          550      565      +15     
  Misses         62       62              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants