Repository navigation
feat(pr): add --pending to save draft review comments - #15
Merged
Merged
Conversation
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.
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.
Summary
Closes #14
This adds
--pendingtobj 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_commentsends"pending": truewhen asked. This field is onpullrequest_commentin the Bitbucket Cloud OpenAPI spec.--file/--line) and reply (--reply-to) comments. With--edit,--delete,--resolveor--unresolveit is rejected.pending: true,bjwarns that the comment is already public instead of claiming it is a draft.bj pr view --commentstags pending comments with(pending).I regenerated the command reference with
scripts/gen_cli_docs.py, added examples forpr comment, and added a line to the skill.Test Plan
tests/test_pr_comment.pyuses 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) anduv build --no-sourcesall pass.