Skip to content

fix(reporter): make TextReporter fail-stop after a writer error - #69

Open
bketelsen wants to merge 1 commit into
mainfrom
cockpit/worker-5f3cdfead19a0207
Open

fix(reporter): make TextReporter fail-stop after a writer error#69
bketelsen wants to merge 1 commit into
mainfrom
cockpit/worker-5f3cdfead19a0207

Conversation

@bketelsen

Copy link
Copy Markdown
Contributor

Summary

  • TextReporter now latches internal failure state on the first io.Writer error (or short write) and makes every later reporting call a silent no-op, matching JSONReporter's existing writer-failure handling, so a partial or failed text stream can never be followed by valid-looking output.
  • Writes are centralized through a single write helper; each method builds its full formatted output and sends it in one call.
  • Docs updated: docs/specs/reporter-package.md and docs/design/overview.md now describe TextReporter's writer-failure behavior as silent and fail-stop.

Test plan

  • reporter/text_test.go: new TestTextReporter_LatchesAfterWriterError uses a writer that partially writes then errors, and proves a later reporting call does not invoke the writer again or append output.
  • All existing TextReporter output, nil-writer, JSONReporter, and NoopReporter tests pass unchanged.
  • make check
  • node scripts/check-docs.mjs

🤖 Generated with Claude Code

Latch internal failure state on the first io.Writer error (or short
write) and make every later reporting call a silent no-op, matching
JSONReporter's existing transport-failure handling, so a partial or
failed text stream can never be followed by valid-looking output.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@bketelsen
bketelsen marked this pull request as ready for review August 25, 2026 00:52
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.

1 participant