Skip to content

refactor(utils): route output through IOStreams and drop dead helpers#34

Merged
pchuri merged 1 commit into
mainfrom
refactor/utils-iostreams
May 10, 2026
Merged

refactor(utils): route output through IOStreams and drop dead helpers#34
pchuri merged 1 commit into
mainfrom
refactor/utils-iostreams

Conversation

@pchuri
Copy link
Copy Markdown
Owner

@pchuri pchuri commented May 10, 2026

Summary

  • displayIssueDetails now takes an io parameter (IOStreams) instead of writing to console.log, so output is testable and consistent with the rest of the codebase.
  • Removed unused helpers success / error / warning / info from lib/utils.jsIOStreams.printSuccess/printError/printWarning/printInfo already provide the same functionality and these were never imported anywhere.
  • Removed unused displayCommentDetails (no callers).
  • Net result: 0 console.* calls in lib/utils.js (was 26).

Why

lib/utils.js was bypassing the IOStreams abstraction in 26 places. That made the output untestable and broke the layering — the rest of the CLI already routes everything through factory.getIOStreams(). Three of the offending exports were also dead code, so this cleans up the public surface area at the same time.

Test plan

  • npm test — 251 tests pass (+2 new for displayIssueDetails)
  • npm run lint — clean
  • Manual: jira issue get <KEY> renders the same output (relies on io.println instead of console.log)

displayIssueDetails now writes via an injected io parameter so tests
and non-TTY callers no longer go through console.log directly. Removed
success/error/warning/info and displayCommentDetails which were unused
and duplicated existing IOStreams methods.
@pchuri pchuri merged commit 911d7d4 into main May 10, 2026
5 checks passed
@pchuri pchuri deleted the refactor/utils-iostreams branch May 10, 2026 06:41
@pchuri pchuri self-assigned this May 10, 2026
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant