buzz
buzz copied to clipboard
feat(cli,sdk): add pull request comments and reviews
Summary
buzz pr commentfor plain and inline PR comments, with--body/--body-fileand repeatable--tobuzz pr review --decision approve|request-changesfor review decisions; the body falls back to a short summary if you don't pass onebuild_git_pr_commentin the SDK, publishing the same kind:1 shape Desktop does: rootetag, repoatag, dedupedptags, plus the review facets- SDK event-shape tests, and the CLI inventory tests updated
Why
The CLI could open and manage PRs but couldn't take part in reviewing one. social publish --reply-to isn't a substitute: it emits an e tag and nothing else, and project clients fetch conversation with kinds:[1] plus #a:[<repoAddress>], so a note without the repo coordinate never reaches a reader.
Fixes #3008
Notes
- Anchor paths are validated, not normalized, same rule as the Desktop anchor validator. Absolute paths,
.and..segments, empty segments, backslashes and NULs are rejected. - Inline comments and review decisions both require
--commit, so a reader knows which revision the comment applies to. If a decision is also anchored,cis emitted once. - Who may review is still a client-side convention, since the relay doesn't enforce it. The builder only checks event shape and doesn't try to reimplement
canReviewProjectPullRequest. - No overlap with #3001, and it follows the same builder pattern.
Verification
cargo test -p buzz-sdk -p buzz-cli— 492 passed, 0 failedcargo clippy -p buzz-sdk -p buzz-cli --all-targets -- -D warnings— cleancargo fmt --check -p buzz-sdk -p buzz-cli— clean- by hand:
buzz pr comment --help/buzz pr review --help, and both an inline comment without--commitand a comment with no body get rejected at parse time