Commenting on a pull request
The most important aspect of a pull request is the discussion it generates. You can comment on the entire pull request, a particular file, or on specific lines of code in a file to generate discussion relevant to your code review. You can also create a task or convert any comment to a task, so actions identified during the review can be easily tracked and resolved. Another efficient way to collaborate is to start a review, allowing you to leave multiple comments or tasks without sending them off to the author until you are ready to publish them.
For more on what you can do in a pull request and an overview to the code review workflow itself, see Reviewing a pull request.
Places in Bitbucket Data Center and Server where you can make comments:
- Overview tab - you can add a comment on the Overview tab (just under 'Activity'), or reply to a previous comment. Use mentions to alert another Bitbucket user to your comment, and use Markdown to add formatting, for example, headings or lists.
- Diff view tab - display and create comments for a file directly on lines of code for commits and pull requests.
Draft multiple comments during a review process
When you are reviewing a pull request and you want to make multiple comments or tasks across various lines of code or files before the pull request is merged, you can manage your workflow more effectively by starting a review rather than adding your comments and submitting them one at a time.
To start a review:
From the pull request you are reviewing, begin by selecting the Start review button in the top, right side of the page. You can also start a review from the comment form by selecting the Start review checkbox.
Type your comment and then select Add comment.
Add any other additional comments or tasks to your review.
While in a review:
- comments are pending and only visible to you
- all comments added will be part of the review
- the author will be notified only when you publish the review
To publish a review:
- Select Finish review to open the Comments in review dialog.
- From here, you can review all of your feedback and add an overview comment.
- When you are ready, select Publish to send the review to the author.
If you want to delete all of the pending comments and tasks without publishing, use Discard review.
You can create an ad-hoc task on the entire pull request, a particular file, or on specific lines of code in a file to track required work identified during a code review. Convert a task into a comment, or a comment into a task. Anyone with repository read permission can convert any other user's comments and tasks (and vice versa). A repository administrator can delete other user's comments or tasks and can also enable a merge check that requires all tasks to be resolved before the pull request can be merged. See Checks for merging pull requests.
For consistent tasks, admins can define default tasks at the project or repository level that are created when the pull request is opened. Learn more about default tasks
To create a pull request task:
- Select Add a comment or the icon on a line of code
- Add your text.
- Select Create task.
When writing a task, you can use markdown to add formatting, images, and attachments to your tasks.
To see all the open and resolved tasks for a pull request:
- Use Shift+T on the pull request page, or click the Open tasks list button.
- Select the 'View on' linked text in the Tasks window to see a task in the context of where it was created.
To resolve tasks for a pull request, select the checkbox next to the open task.
As a reviewer of a pull request in Bitbucket, you can suggest a small change to the code by leaving a suggestion right inside the comment or task itself. If you have write access to the source repository, you can commit the suggested change directly in the pull request without further action.
To create a pull request suggestion on a single line of code:
In the comment dialog, click.
Type your suggestion in the code block. You can also add any feedback outside of that code block.
To apply a pull request suggestion:
- Select Apply suggestion.
- Edit the commit message if required and then select Commit changes to add a new commit to the pull request.
React to comments
Sometimes there's nothing more to say, and a 👀 or 👍 is all you need when replying to a comment.
To react to a comment with an emoji, select the Add reaction button, then select an emoji.
To remove an emoji from a comment, select it and it will disappear.
Viewing other comments in Bitbucket
When updating a pull request, comments that are in older diffs or that have become outdated due to a pull request update will become hidden. To view them, click the other comments counter button at the top of the page to open a dialog box with more context as to why code has changed throughout a pull request. You’ll be able to:
- see a file's activity stream showing comments that are outdated or appear on another diff
- distinguish which comments are actually outdated
- reply to, like, delete, or react to outdated comments the same way you can from the overview tab
Was this helpful?Yes Provide feedback about this article