Fix non-TTY gh issue view --comments output for zero-comment issues#13482
Open
sergiou87 wants to merge 1 commit into
Open
Fix non-TTY gh issue view --comments output for zero-comment issues#13482sergiou87 wants to merge 1 commit into
gh issue view --comments output for zero-comment issues#13482sergiou87 wants to merge 1 commit into
Conversation
Include the raw issue preview in non-TTY output when --comments is used so issues with zero comments no longer emit empty output. Add a regression test covering the zero-comment case. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a regression where gh issue view --comments produced no output when stdout is non-TTY and the issue had zero comments, by ensuring the raw issue preview is always printed and comments are appended only when present.
Changes:
- Always print the raw (non-TTY) issue preview even when
--commentsis provided. - Append raw comments after the preview only when at least one comment node exists.
- Add a regression test covering the
--comments+ zero-comments non-TTY scenario.
Show a summary per file
| File | Description |
|---|---|
| pkg/cmd/issue/view/view.go | Adjusts non-TTY execution path to always emit the raw issue preview and conditionally append raw comments. |
| pkg/cmd/issue/view/view_test.go | Extends non-TTY tests to assert preview output for --comments, including the zero-comment regression case. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #13452
Summary
gh issue view --commentsis usedTesting
go test ./pkg/cmd/issue/view/...ghlocally and reran the issue reproduction commands againstsaurabhav88/EnviousWispr#779go test ./...hits an unrelated localsafe.bareRepositoryfailure ingit/client_test.gomake lintrequiresgolangci-lintin the local environment