buzz icon indicating copy to clipboard operation
buzz copied to clipboard

feat(cli,sdk): add pull request comments and reviews

Open aeonbilal opened this issue 4 months ago • 0 comments

Summary

  • buzz pr comment for plain and inline PR comments, with --body / --body-file and repeatable --to
  • buzz pr review --decision approve|request-changes for review decisions; the body falls back to a short summary if you don't pass one
  • build_git_pr_comment in the SDK, publishing the same kind:1 shape Desktop does: root e tag, repo a tag, deduped p tags, 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, c is 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 failed
  • cargo clippy -p buzz-sdk -p buzz-cli --all-targets -- -D warnings — clean
  • cargo 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 --commit and a comment with no body get rejected at parse time

aeonbilal avatar Jul 26 '26 17:07 aeonbilal