Skip to content

fix(issue): include comments in issue view JSON output - #185

Open
Eotel wants to merge 2 commits into
nulab:mainfrom
Eotel:Eotel/bee-comments-upstream
Open

Eotel wants to merge 2 commits into
nulab:mainfrom
Eotel:Eotel/bee-comments-upstream

Conversation

@Eotel

@Eotel Eotel commented Oct 27, 2026 •

Copy link
Copy Markdown

Summary

Include the fetched comments in bee issue view --comments --json, so scripts can read the comments requested by the flag.

 bee issue view PROJECT-123 --comments --json
 {
   ...issue
+  "comments": [...raw comment objects]
 }

The command uses the existing ascending-order request. JSON output preserves the raw comment objects, including change-log entries, and includes an empty array when no comments are returned. Without --comments, the issue JSON and API requests stay unchanged.

Evidence

  • Before: On bee 1.1.1 and main at 707ab80, a live issue's comments API returned one comment, but issue view --comments --json omitted comments. --json comments returned {}. Three regression cases failed before the fix.
    After: The built CLI includes that comment. Both full JSON and --json comments match the raw API response; issue JSON without the flag remains unchanged.

Test plan

  • vp check
  • vp test
  • vp run --filter @nulab/bee build
  • Read-only verification of the built CLI against a live Backlog issue, comparing full JSON, comments-only JSON, and JSON without --comments to the API responses.

Regression tests cover raw comments in full and filtered JSON, an empty comments array, and unchanged JSON without fetching comments when the flag is absent. They parse the JSON they check, so they pass whether or not stdout is a TTY. Existing tests cover human-readable output and the browser path.

Merge Danger

Door: Two-way

The change can be reverted without a data migration.

Blast Radius: Issue

Adds the requested comments property to JSON only when --comments is set. Pagination and human-readable output are unchanged. The request still returns only the 20 oldest comments; #186 tracks that.

Closes #184

@Eotel
Eotel requested a review from lollipop-onl as a code owner October 27, 2026 07:04
outputResult pretty-prints JSON when stdout is a TTY, so asserting the compact string made the tests depend on the runner's stdout. Parse the written JSON instead, as api.test.ts does.

Also drop the request-parameter assertion from the JSON test; the existing --comments test already covers the request.

This branch has not been deployed

No deployments
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.

bug(issue view): --comments is ignored in JSON output

1 participant