Skip to content

feat(pr): add --pending to save draft review comments - #15

Merged
Spenhouet merged 1 commit into
Spenhouet:mainfrom
josiglo:feat/pr-comment-pending
Oct 3, 2026
Merged

Spenhouet merged 1 commit into
Spenhouet:mainfrom
josiglo:feat/pr-comment-pending

Conversation

@josiglo

@josiglo josiglo commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #14

This adds --pending to bj pr comment. It saves the comment as a draft review comment that only I can see. The drafts are published together when I press "Finish review" on the pull request in Bitbucket.

How it works:

  • add_pr_comment sends "pending": true when asked. This field is on pullrequest_comment in the Bitbucket Cloud OpenAPI spec.
  • The flag works for top-level, inline (--file/--line) and reply (--reply-to) comments. With --edit, --delete, --resolve or --unresolve it is rejected.
  • If Bitbucket answers without pending: true, bj warns that the comment is already public instead of claiming it is a draft.
  • bj pr view --comments tags pending comments with (pending).
  • The spec has no endpoint to publish drafts, so I left that out. Publishing stays a click in the web UI. The help text and docs say so.

I regenerated the command reference with scripts/gen_cli_docs.py, added examples for pr comment, and added a line to the skill.

Test Plan

  • New tests/test_pr_comment.py uses a fake client. It covers the default path, pending inline comments, pending replies, the warning when Bitbucket publishes anyway, the rejected flag combinations and the (pending) tag in the thread view.
  • uv run ruff check, uv run pytest (141 passed) and uv build --no-sources all pass.

Bitbucket Cloud lets a comment be created with "pending": true. It then
stays a draft that only its author sees until they press Finish review on
the pull request. bj pr comment --pending sets that field for top-level,
inline and reply comments. The API has no call to publish drafts, so that
step stays in the web UI. If the response comes back without pending, bj
warns that the comment is already public.

bj pr view --comments now tags pending comments.
@Spenhouet
Spenhouet merged commit aed21cf into Spenhouet:main Oct 3, 2026
2 checks passed
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.

Support pending (draft) PR review comments

2 participants