feat(dc): add --details flag and thread nesting for pr comments#110
feat(dc): add --details flag and thread nesting for pr comments#110avivsinai merged 11 commits intoavivsinai:masterfrom
Conversation
|
Perfect timing. This is exactly what I need. |
|
Hi @ivulub, thanks for the PR. The GitHub is currently showing merge conflicts with |
avivsinai
left a comment
There was a problem hiding this comment.
Thanks for the PR, @ivulub — the --details flag and thread nesting are a solid addition. The activities endpoint switch and flattenComments tree-walking are well done.
One issue to address before this can merge:
Unresolved comments don't show resolution status
In --details mode, the code prints Resolved: yes when a thread is resolved but prints nothing when it isn't (DC path at comments.go:134-137, Cloud path at comments.go:224-226). Since --details is specifically meant to surface resolution status, unresolved comments should explicitly render Resolved: no — otherwise the main data point disappears for exactly the comments the reviewer most needs to find.
Non-blocking suggestions:
- DC file comments without a line number render as
File: path:0(comments.go:121-123). Whenc.Anchor.Lineis 0, consider omitting the:%dsuffix to match the Cloud path behavior. - Breaking
--jsonshape change: The DCPullRequestComment.Authorchanged from nested{"author":{"user":{...}}}to flat{"author":{...}}. This is arguably the right simplification, but it's a breaking change for anyone consuming--jsonoutput. Worth noting in the changelog or PR description.
Happy to re-review once updated.
8e52915 to
d727a26
Compare
|
Hi @ivulub — checking in on this. The dependency (#109) has merged and there are no merge conflicts, which is great. The primary blocking finding from the previous review is still unaddressed: unresolved comments should explicitly show Correction from my previous review: the Let me know if you need any help with the changes. |
d727a26 to
cbc38fe
Compare
|
Rebased onto master and addressed the feedback:
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Cover validation (missing/invalid PR ID, invalid --state, --state on DC), DC comment listing with activity filtering, Cloud comment listing with state filtering (all/resolved/unresolved), and empty result handling for both backends. Addresses the codecov/patch failure on PR #110. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Hi! We merged the additional pr-comments test coverage into |
Show file:line, Comment/Task distinction, resolved/complete status. Flatten nested reply threads with depth-based indentation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Also omit line suffix when DC anchor line is 0.
Tasks previously omitted Resolved status. Now both Complete and Resolved are always printed for tasks in --details mode.
b8160e2 to
1e60958
Compare
|
Rebased onto latest master (includes #140). The conflict in Latest commit: Tasks in |
|
Updated |
avivsinai
left a comment
There was a problem hiding this comment.
Re-review found one remaining issue.
In non---details DC output, nested replies use truncate(c.Text, 80-2*c.Depth) in pkg/cmd/pr/comments.go. Once the reply depth reaches 39+, that width drops to 2 or less, and truncate slices with maxLen-3, which will panic. Since this PR now flattens arbitrary reply trees from the API, the display width needs clamping before truncation (or truncate needs to handle very small widths safely).
The rest of the rereview was clean: the new Complete/Resolved task output is covered, docs match the flag, and go test ./pkg/cmd/pr/... ./pkg/bbdc/..., go vet ./pkg/cmd/pr/... ./pkg/bbdc/..., gofmt -d pkg/cmd/pr pkg/bbdc, and go build ./cmd/bkt all passed.
|
Comment depth is now capped at 20, with a |
avivsinai
left a comment
There was a problem hiding this comment.
Reviewed with Claude via AMQ. Latest head is green and looks good to merge.
Add the missing Unreleased notes for the notable changes merged after v0.23.0 so the next release can be cut through the supported release PR flow. This covers the Data Center PR comments details view, PKCE in the Bitbucket Cloud OAuth login flow, and the release-pipeline attestation/gate tightening. Refs GH-110 Refs GH-162 Refs GH-164
Summary
--detailsflag for verbose output: file:line, resolved/complete status, full comment textFixes #108. Depends on #109.
Sample output
Default mode (threads indented):
With
--details:Test plan
TestListPullRequestCommentsFlattensRepliesverifies depth-first flatteninggo test ./pkg/bbdc/...)bkt pr comments <id> --detailson a Bitbucket DC instance with threaded comments and tasks🤖 Generated with Claude Code